Last active
September 30, 2019 14:18
-
-
Save mambax/d3e3d7afdc732115f172aaecbae2b0ae to your computer and use it in GitHub Desktop.
Interview
This file contains 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
// What is wrong with this code snippet? | |
new Promise((resolve, reject) => { | |
throw new Error('error') | |
}) | |
.then(console.log) |
This file contains 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
interface IResource { | |
id: string; | |
homeLocation: ILocation | null; | |
} | |
export class ResourceFilter { | |
public static filterResources(resources: IResource[], enforceHomeLocation: boolean): IResource[] { | |
// Return a new list of resources that only contains items depending on enforceHomeLocation | |
}; | |
} |
This file contains 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
// Put a cherry to newFruits2 with the ... spread operator | |
let fruits = ['Apple','Orange','Banana']; | |
let newFruits = fruits.unshift('Cherry'); | |
let newFruits2; |
This file contains 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
// What's dangerous within the code snippet? | |
express().get('/', (req, res) => { | |
const data = fs.readFileSync('sample.json'); | |
res.json(data); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment