Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Hocus Pocus

Veronička lspdv

:electron:
Hocus Pocus
  • Prague
View GitHub Profile
View keybase.md

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 Sep 5, 2017
Finish line `var sayHello = ` so the whole code example prints "Hello John" to the console
View quiz.js
//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 Sep 8, 2017
How would you change the second line in the following example so that it prints numbers 0, 1, 2, 3 in this order
View quiz.js
//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 Sep 8, 2017
Given the following code, I understand what the output will be:
View quiz.js
//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();