diff --git a/array_map_parseint/README.md b/array_map_parseint/README.md index 419984a..a3d2668 100644 --- a/array_map_parseint/README.md +++ b/array_map_parseint/README.md @@ -45,7 +45,7 @@ When we execute the previous code, this is that it's executed when we run the Sn * parseInt(1000000, 6) => 46656 ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/autoexecute/README.md b/autoexecute/README.md index a78c458..4231dfe 100644 --- a/autoexecute/README.md +++ b/autoexecute/README.md @@ -20,7 +20,7 @@ SyntaxError: Unexpected token ) ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -38,7 +38,7 @@ undefined ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -57,7 +57,7 @@ The value of testValue is undefined because the function has not been autoexecut ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/banking/README.md b/banking/README.md index be7f030..f84f56b 100644 --- a/banking/README.md +++ b/banking/README.md @@ -22,18 +22,18 @@ var yourChange = calculateChange(); --- -What returns calculateAmountOfStockOptions ? Input the number value. +What returns calculateAmountOfStockOptions ? ```js -var stockOptions = ; + ``` ```js -var stockOptions = 1.94392523364486; +1.94392523364486 ``` ```js -assert(stockOptions == 1.94392523364486); +__match_answer_and_solution__ ``` --- @@ -43,15 +43,15 @@ assert(stockOptions == 1.94392523364486); What is the value of calculateChange ? Input the number value. ```js -var change = ; + ``` ```js -var change = 10.100000000000001; +10.100000000000001 ``` ```js -assert(change == 10.100000000000001); +__match_answer_and_solution__ ``` --- @@ -65,11 +65,11 @@ Why? ``` ```js -'Javascript has several problems operating with floating point, this is one of the causes that it should not be to operate with floats.' +Javascript has several problems operating with floating point, this is one of the causes that it should not be to operate with floats. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/conditionals_functions/README.md b/conditionals_functions/README.md index 56e9fc4..5e40652 100644 --- a/conditionals_functions/README.md +++ b/conditionals_functions/README.md @@ -65,6 +65,6 @@ The execution of Snippet 3 shows "That's true" because when the code has been ev ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/delete/README.md b/delete/README.md index ef1c5c4..b71d901 100644 --- a/delete/README.md +++ b/delete/README.md @@ -57,7 +57,7 @@ Why **#1: John** is logged? John is logged because name is a global variable and global variables can't be deleted. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -73,7 +73,7 @@ Why **#2: undefined** is logged? undefined is logged because we have deleted the name property of obj, properties or members of objects can be deleted excluding the properties or members of the global object. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -89,7 +89,7 @@ Why **#3: function toString() { [native code] }** is logged? function toString() { [native code] } is logged because toString is an inherited method from Object and inherited methods or members can't be deleted. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -105,7 +105,7 @@ Why **#4: animal** is logged? animal is logged because we have deleted the own mammal.name property but the inherited property is shown. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- \ No newline at end of file diff --git a/even_odd/README.md b/even_odd/README.md index 0584aa2..7d4074f 100644 --- a/even_odd/README.md +++ b/even_odd/README.md @@ -57,7 +57,7 @@ Number.MAX_VALUE can't be handled properly by Javascript to work with it in oper ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/fooling_around_boolean/README.md b/fooling_around_boolean/README.md index ae14e0c..1660ec8 100644 --- a/fooling_around_boolean/README.md +++ b/fooling_around_boolean/README.md @@ -22,7 +22,7 @@ Why does xor resolves in an unexpected manner? Because this is not false, this inside the function is the complete object and it evaluates to true when it's converted to true the same way that !!{} is true. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- diff --git a/fooling_around_boolean_2/README.md b/fooling_around_boolean_2/README.md index 036438b..be4928c 100644 --- a/fooling_around_boolean_2/README.md +++ b/fooling_around_boolean_2/README.md @@ -39,6 +39,6 @@ Why does calling the previous statement returns false? You have to be careful when using |= because when it's used to perform a test besides an object it will not modify the original value, then it remains to be zero. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- \ No newline at end of file diff --git a/ghost_array/README.md b/ghost_array/README.md index 736e63b..87bdb1a 100644 --- a/ghost_array/README.md +++ b/ghost_array/README.md @@ -13,13 +13,13 @@ console.log(arr.length); What is the result of execute "Snippet 1" code? ```js -var result = ; + ``` ```js -var result = 1000; +1000 ``` ```js -assert(result === 1000); +__match_answer_and_solution__ ``` --- @@ -34,13 +34,13 @@ console.log(arr.length); What is the result of execute "Snippet 2" code? ```js -var result = ; + ``` ```js -var result = 0; +0 ``` ```js -assert(result === 0); +__match_answer_and_solution__ ``` --- @@ -54,7 +54,7 @@ Why? Because 4294967295 overflows the max number of elements that could be handled by Javascript in Arrays. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -70,13 +70,13 @@ console.log(arr[4294967295]); What is the result of execute "Snippet 3" code? ```js -var result = ; + ``` ```js -var result = "james"; +"james" ``` ```js -assert(result === "james"); +__match_answer_and_solution__ ``` --- @@ -90,7 +90,7 @@ Why? Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -106,13 +106,13 @@ console.log(arr.length); What is the result of execute "Snippet 4" code? ```js -var result = ; + ``` ```js -var result = 0; +0 ``` ```js -assert(result === 0); +__match_answer_and_solution__ ``` --- @@ -126,7 +126,7 @@ Why? Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -142,13 +142,13 @@ console.log(arr[Number.MIN_VALUE]); What is the result of execute "Snippet 5" code? ```js -var result = ; + ``` ```js -var result = "mary"; +"mary" ``` ```js -assert(result === "mary"); +__match_answer_and_solution__ ``` --- @@ -162,6 +162,6 @@ Why? Javascript arrays can work as objects, dictionaries, when you are using as key any value that can not be handled by Array objects. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- \ No newline at end of file diff --git a/hoisting1/README.md b/hoisting1/README.md index 108daff..5bdc161 100644 --- a/hoisting1/README.md +++ b/hoisting1/README.md @@ -25,11 +25,11 @@ Why this is happening? ``` ```js -'This is happening because the hoisting problem. Remember that in Javascript there are no block variables.' +This is happening because the hoisting problem. Remember that in Javascript there are no block variables. ``` ```js -assert(true); +__match_answer_and_solution__ ``` --- @@ -63,7 +63,18 @@ var bird = 'Pidgeons'; ``` ```js -assert(true); +assert(inputs[0] === 'Bert loves his Pidgeons'); ``` +```js +var inputs = []; +var backConsole = console; +var console = { + log: function (str) { + inputs.push(str); + backConsole.log(str); + console = backConsole; + } +}; +``` --- diff --git a/input_search/README.md b/input_search/README.md index 6881825..89e7f53 100644 --- a/input_search/README.md +++ b/input_search/README.md @@ -51,23 +51,40 @@ $( document ).ready( function() { } ); ``` ```js +function delayTimer(delay){ + var timer; + return function(fn){ + timer = clearTimeout(timer); + if(fn) + timer = setTimeout(function() { + fn(); + },delay); + + return timer; + }; +} +var delayer = delayTimer(500); + $( document ).ready( function() { $( '#inputSearch' ).keyup( function() { - $.ajax( { - url: 'http://www.domain.com/search', - data: this.value, - success: function ( data ) - { - var results = data.results; - $( '#list' ).empty(); - $.each( data, function ( item ) { - $( '#list' ).append( '