Skip to content

Commit

Permalink
Merge pull request tcorral#2 from master-lincoln/fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
tcorral committed Apr 12, 2014
2 parents 931804b + e1d3e35 commit 7f2dc83
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions hoisting1/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hoisting and Conditionals Statements

I'm Ernie and my friend is Bert and we wrote this code to tell other people which typeo of birds we like.
I'm Ernie and my friend is Bert and we wrote this code to tell other people which type of birds we like.

```
var bird = 'Pidgeons';
Expand Down Expand Up @@ -66,4 +66,4 @@ var bird = 'Pidgeons';
assert(true);
```

---
---
16 changes: 8 additions & 8 deletions objects1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var key,

for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
console.log( key + ' exist in obj' );
console.log( key + ' exists in obj' );
console.log( key + ': ' + obj[key] );
continue;
}
Expand All @@ -22,17 +22,17 @@ for ( key in obj ) {
... and the result of executing it is...

```
name exist in obj
name exists in obj
name: john
surname exist in obj
surname exists in obj
surname: doe
```

... but we want to get the following result, can you help us?

```
name doesn't exist in obj
surname exist in obj
surname exists in obj
surname: doe
```

Expand All @@ -50,7 +50,7 @@ var key,

for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
console.log( key + ' exist in obj' );
console.log( key + ' exists in obj' );
console.log( key + ': ' + obj[key] );
continue;
}
Expand All @@ -73,15 +73,15 @@ Object.prototype.hasOwnProperty = function (key) {

for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
console.log( key + ' exist in obj' );
console.log( key + ' exists in obj' );
console.log( key + ': ' + obj[key] );
continue;
}
console.log( key + " doesn't exist in obj" );
}
```
```js
assert(items.length == 3 && items[0] == 'name doesn\'t exist in obj' && items[1] == 'surname exist in obj' && items[2] == 'surname: doe');
assert(items.length == 3 && items[0] == 'name doesn\'t exist in obj' && items[1] == 'surname exists in obj' && items[2] == 'surname: doe');
```
```js
var items = [];
Expand All @@ -98,4 +98,4 @@ var console = {
}
};
```
---
---
11 changes: 7 additions & 4 deletions objects2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As you know Javascript has two different ways to treat the data it receives as a
See the following code:

```
var oPerson = { name: 'john'};
var oPerson = { name: 'john' };
(function(oTeacher) {
window.getTeacher= function() {
Expand Down Expand Up @@ -42,7 +42,7 @@ Object { name: "john", surname: "doe" }

---

Explain what this is happening:
Explain why this is happening:

```js

Expand All @@ -60,7 +60,10 @@ assert(true);

---

Fix the code to :
Fix the code to make the third execution return
```
Object { name: "mary", surname: "sullivan" }
```

```js
var oPerson = { name: 'john'};
Expand Down Expand Up @@ -119,4 +122,4 @@ var console = {
}
};
```
---
---

0 comments on commit 7f2dc83

Please sign in to comment.