Skip to content

Instantly share code, notes, and snippets.

@mambax
Last active September 30, 2019 14:18
Show Gist options
  • Save mambax/d3e3d7afdc732115f172aaecbae2b0ae to your computer and use it in GitHub Desktop.
Save mambax/d3e3d7afdc732115f172aaecbae2b0ae to your computer and use it in GitHub Desktop.
Interview
// What is wrong with this code snippet?
new Promise((resolve, reject) => {
throw new Error('error')
})
.then(console.log)
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
};
}
// Put a cherry to newFruits2 with the ... spread operator
let fruits = ['Apple','Orange','Banana'];
let newFruits = fruits.unshift('Cherry');
let newFruits2;
// 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