Skip to content

Commit

Permalink
Merge pull request tcorral#6 from master-lincoln/fixes
Browse files Browse the repository at this point in the history
Language fixes
  • Loading branch information
tcorral committed Apr 12, 2014
2 parents a8f85e9 + c5b34e9 commit 91af659
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
10 changes: 5 additions & 5 deletions even_odd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We have the following code that should return only the odd numbers in reverse order that are in values...

```
```js
(function() {
var values = [3, 8, '15', Number.MAX_VALUE, Infinity, -23],
oddValues = [],
Expand All @@ -21,11 +21,11 @@ We have the following code that should return only the odd numbers in reverse or
}());
```

...but when this code is executed we get [-23, Infinity, "15", 3].
...but when this code is executed we get ``[-23, Infinity, "15", 3]``.

Ah! Maybe Number.MAX_VALUE is a even number then why not deduct 1 and check it again?
Ah! Maybe Number.MAX_VALUE is a even number then why not substract 1 and check it again?

```
```js
(function() {
var values = [3, 8, '15', (Number.MAX_VALUE -1), Infinity, -23],
oddValues = [],
Expand All @@ -43,7 +43,7 @@ Ah! Maybe Number.MAX_VALUE is a even number then why not deduct 1 and check it a
console.log( oddValues );
}());
```
...but when this code is executed I get [-23, Infinity, "15", 3] again.
...but when this code is executed we get ``[-23, Infinity, "15", 3]`` again.

---
Please explain why Number.MAX_VALUE has not been added:
Expand Down
6 changes: 3 additions & 3 deletions frozen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
This challenge will need a bit of knowledge of one of the new features in Javascript 1.8.5, this feature is Object.freeze to get the correct result.

---
Assume:
Note:
* You can use anything of ECMASCRIPT 5 but not DOM or BOM, just Javascript
* There are more than one answer but only the most simple will win.
* There is more than one answer but only the most simple will win.

Here you have the code to be fixed:
```js
Expand Down Expand Up @@ -39,4 +39,4 @@ var result = dog.talk();
assert( result === 'Bark!');
```

---
---
2 changes: 1 addition & 1 deletion json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ console.log( parentStringified === '{ "name": "peter", "surname": "doe" }');

---

Write the code needed to get the expected result without change obj.name and obj.surname values:
Write the code needed to get the expected result without changing the values of ``obj.name`` and ``obj.surname`` values:

```js
var obj = {
Expand Down
7 changes: 3 additions & 4 deletions spartacus/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Spartacus
I like so much Spartacus TV Series so that I have written the following code to get the name of the different seasons but something goes wrong...
I like the TV series Spartacus so much, that I have written the following code to get the name of the different seasons but something goes wrong...
```
var season = 'first';
Expand All @@ -17,10 +17,9 @@ var result = ('Spartacus: ' + season === 'first' ? 'Blood and Sand' : 'Gods of t

```js
var season = 'first';
var result = ('Spartacus: ' +
((season === 'first') ? 'Blood and Sand' : 'Gods of the Arena') );
var result = 'Spartacus: ' + (season === 'first' ? 'Blood and Sand' : 'Gods of the Arena');
```

```js
assert(result === 'Spartacus: Blood and Sand');
```
```
8 changes: 4 additions & 4 deletions terminator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Here you have the prototype code of the next Terminator fan page:
</body>
</html>
```
One of my colleagues have written the next code that will log the name we send using the form in the previous page.
One of my colleagues has written the next code that will log the name we send using the form in the previous page.
```
<script>
function sayonara( name ) {
Expand All @@ -25,12 +25,12 @@ One of my colleagues have written the next code that will log the name we send u
sayonara( greetings );
</script>
```
But then someone sent the next message as a name and the behaviour of the page has changed...
But then someone sends the next message as a name and the behaviour of the page changes...
```
'</script><script>console.log("I will come back!")</script><script>'
```

Here is an example of execute the page with the bug:
Here is an example of executing the page with the bug:
```
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -71,4 +71,4 @@ console.log(result);
assert(result === 'Sayonara <\/script><script>console.log("I will come back!")<\/script><script>!');
```

---
---

0 comments on commit 91af659

Please sign in to comment.