Skip to content

Instantly share code, notes, and snippets.

View lspdv's full-sized avatar
:electron:
Hocus Pocus

Veronička lspdv

:electron:
Hocus Pocus
  • Prague
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lspdv on github.
  • I am lspdv (https://keybase.io/lspdv) on keybase.
  • I have a public key ASCnWdixiniD6qPmm-o1PDJjmk840P8B0WH1muGjzfhFiAo

To claim this, I am signing this object:

@lspdv
lspdv / quiz.js
Last active September 5, 2017 07:04
Finish line `var sayHello = ` so the whole code example prints "Hello John" to the console
//Finish line `var sayHello = ` so the whole code example prints "Hello John" to the console
//Please answer fill only to the registration form for MSD Code Academy :-)
var hello = {
name: 'John',
sayHello: function() {
return 'Hello ' + this.name
}
}
var sayHello = ...
@lspdv
lspdv / quiz.js
Last active September 8, 2017 10:16
How would you change the second line in the following example so that it prints numbers 0, 1, 2, 3 in this order
//How would you change the second line in the following example so that it prints numbers 0, 1, 2, 3 in this order?
//Please answer fill only to the registration form for MSD Code Academy :-)
for (var i = 0; i < 4; i++) {
setTimeout(() => console.log(i), 0)
}
//A: By changing line 2) ... (function(number) { setTimeout(() => console.log(number), 0)})(i)
//B: By changing line 1) ... for (let i = 0; i < 4; i++) {
//C: By changing line 2) ... var temp = i; setTimeout(() => console.log(temp), 0)
//D: By changing line 2) ... setTimeout((i) => console.log(i), 0)
@lspdv
lspdv / quiz.js
Last active September 8, 2017 10:17
Given the following code, I understand what the output will be:
//Given the following code, I understand what the output will be
//Please answer fill only to the registration form for MSD Code Academy :-)
const obj = {
name: 'John',
getName () {
return this.name;
}
};
const name1 = obj.getName();