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
/* | |
A short game where the player is required to complete the name of a country. Hints are also given. | |
*/ | |
var rightHintCharacterAmount; | |
var leftHintCharacterAmount; | |
var randomNumber; | |
var countryChosen; | |
var countriesArray = [ |
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
function foo (str, a) { | |
eval(str); //cheating | |
console.log(a, b); | |
} | |
var b = 2; | |
foo( "var b = 3;", 1);//1, 3 |
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
function foo (str, a) { | |
eval(str); //cheating | |
console.log(a, b); | |
} | |
var b = 2; | |
foo( "console.log(b);", 1 );//2, 1, 2 |
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
function foo(str) { | |
"use strict"; | |
eval( str ); | |
console.log( a ); //ReferenceError: a is not defined | |
} | |
foo( "var a = 2;" ); |
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
console.log(b); | |
b=10; |
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
console.log(b); | |
b=10; |
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
function foo (a) { | |
console.log(a); | |
b = 3; | |
function bar(c) { | |
console.log(b + c); | |
} | |
bar(4); | |
} |
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
var foo = 2; | |
foo(); |
OlderNewer