This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//== Wrong way | |
export class User { | |
name: string; | |
age: number; | |
accessToken: string; | |
constructor(options: { | |
age: number; | |
name: string; | |
accessToken?: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const User = { | |
id: 123, | |
username: 'John', | |
email: '[email protected]', | |
addons: [ | |
{ name: 'First addon', id: 1 }, | |
{ name: 'Second addon', id: 2 } | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement function `searchFile`. You give a substring, functions returns true if query satisfied to filename or false; | |
searchFile('crdle', 'crocodile.txt') // true | |
searchFile('le', 'crocodile.txt') // true | |
searchFile('el', 'crocodile.txt') // false | |
searchFile('coco', 'crocodile.txt') // true | |
searchFile('crdleee', 'crocodile.txt') // false | |
searchFile('crkdl', 'crocodile.txt') // false | |
Tip: `two pointers` |
OlderNewer