Skip to content

Commit

Permalink
Fix matching solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
tcorral committed Apr 13, 2014
1 parent c27bcac commit 715ef04
Show file tree
Hide file tree
Showing 23 changed files with 118 additions and 91 deletions.
2 changes: 1 addition & 1 deletion array_map_parseint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---
Expand Down
6 changes: 3 additions & 3 deletions autoexecute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SyntaxError: Unexpected token )
```

```js
assert(true);
__match_answer_and_solution__
```

---
Expand All @@ -38,7 +38,7 @@ undefined
```

```js
assert(true);
__match_answer_and_solution__
```

---
Expand All @@ -57,7 +57,7 @@ The value of testValue is undefined because the function has not been autoexecut
```

```js
assert(true);
__match_answer_and_solution__
```

---
Expand Down
18 changes: 9 additions & 9 deletions banking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```

---
Expand All @@ -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__
```

---
Expand All @@ -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__
```

---
Expand Down
2 changes: 1 addition & 1 deletion conditionals_functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---
8 changes: 4 additions & 4 deletions delete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---
Expand All @@ -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__
```
---
Expand All @@ -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__
```

---
Expand All @@ -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__
```

---
2 changes: 1 addition & 1 deletion even_odd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---
Expand Down
2 changes: 1 addition & 1 deletion fooling_around_boolean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```

---
Expand Down
2 changes: 1 addition & 1 deletion fooling_around_boolean_2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---
38 changes: 19 additions & 19 deletions ghost_array/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---

Expand All @@ -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__
```
---
17 changes: 14 additions & 3 deletions hoisting1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
```

---
Expand Down Expand Up @@ -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;
}
};
```
---
48 changes: 34 additions & 14 deletions input_search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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( '<li>' + item + '</li>' );
} );
delayer(function() {
var $list = $( '#list' );
$.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( '<li>' + item + '</li>' );
} );

},
error: function ( xhr, status, error ) {
console.log( 'Something goes wrong!', status, error.message );
}
},
error: function ( xhr, status, error ) {
console.log( 'Something goes wrong!', status, error.message );
}
} );
} );
} );
} );
Expand All @@ -79,6 +96,9 @@ assert(counter === 1);
```js
var document = '';
var counter = 0;
var setTimeout = function (cb) {
cb();
};
var $ = function ( element ) {
var jQuery = {
ready: function ( callback ) {
Expand Down
2 changes: 1 addition & 1 deletion intro/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#Exercises
#
Loading

0 comments on commit 715ef04

Please sign in to comment.