Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 744f415

Browse files
committed
apdat question-three and question-six
1 parent 2e56828 commit 744f415

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Week2/Homework/assets/question-six.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
let nlCities = [];
2-
console.log('the value of the array is 0');
2+
console.log('the value of the array is undefined');
33
console.log(nlCities);
44

55
const daanFavAnimals = ['lions', 'lynxes', 'Hawks'];
66
console.log(daanFavAnimals);
77

88
daanFavAnimals[3] = 'baby pig';
9+
console.log(daanFavAnimals);
10+
11+
// The use of push method to add new element to an array
12+
daanFavAnimals.push('Horse');
13+
console.log(daanFavAnimals);
914

15+
// Push method can be applyed on this way too
16+
console.log(daanFavAnimals.push('Frog'));
1017
console.log(daanFavAnimals);

Week2/Homework/assets/question-three.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
let x;
22
// x is not defined yet.
3-
console.log('the value of x will be: 5');
4-
x = 5;
3+
console.log('the value of x will be: undefined');
54
console.log(x);
65

76
x = 6;

0 commit comments

Comments
 (0)