Skip to content

Instantly share code, notes, and snippets.

@kampana
Last active January 23, 2020 06:35
Show Gist options
  • Save kampana/7d493949add6ad279759cde74320fe30 to your computer and use it in GitHub Desktop.
Save kampana/7d493949add6ad279759cde74320fe30 to your computer and use it in GitHub Desktop.
function question1() {
setTimeout( () => {
console.log('Hello');
});
console.log('World');
// Output?
}
function question2() {
let obj = {
text: 'Hello',
myFunction : function() {
console.log(this.text);
}
}
obj.myFunction(); // Output?
let myOtherFunction = obj.myFunction;
myOtherFunction(); // Output? Why?
let data = {
name: 'Foo',
family: 'Bar'
}
console.log(data.family) // Runtime complexity?
let arr = [1,2,3,4,5];
console.log(arr.filter( item => item > 3)) // Output? Runtime?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment