Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit 6975033

Browse files
committed
week3 excercises are completed(first part)
1 parent 6bd6418 commit 6975033

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

week-3/1-exercises/H-array-methods-2/exercise.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var everyone = [
1515
"Swathi"
1616
];
1717

18-
var firstFive; // complete this statement
19-
var lastFive; // complete this statement
18+
var firstFive=everyone.slice(0,5); // complete this statement
19+
var lastFive=everyone.slice(-5); // complete this statement
2020

2121
/*
2222
DO NOT EDIT BELOW THIS LINE

week-3/1-exercises/H-array-methods-2/exercise2.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
For example, capitailise("hello") should return "Hello"
77
Tip: use the string method .split() and the array method .join()
88
*/
9+
//return name.split("")[0].toUpperCase() + name.slice(1);
10+
function capitalise(str) {
11+
return str.split("")[0].toUpperCase().concat(str.slice(1));
912

10-
function capitalise(str) {}
13+
}
1114

1215
/*
1316
DO NOT EDIT BELOW THIS LINE

week-3/1-exercises/H-array-methods-2/exercise3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var ukNations = ["Scotland", "Wales", "England", "Northern Ireland"];
88

99
function isInUK(country) {
10-
return; // complete this statement
10+
return ukNations.some(name=>name.includes(country)); // complete this statement
1111
}
1212

1313
/*

0 commit comments

Comments
 (0)