Skip to content

Commit c64442c

Browse files
committed
wk2 updated done
1 parent 0d8bd42 commit c64442c

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict'
2+
3+
let drinkTray = [];
4+
const drinkTypes = ["cola","lemondade", "water"];
5+
6+
for (let i = 0; i < 5; i++) {
7+
if (i >2) {
8+
drinkTray.push(drinkTypes[i-3]);
9+
} else {
10+
drinkTray.push(drinkTypes[i]);
11+
}
12+
}
13+
14+
console.log("Hey guys i brought a " + drinkTray.sort() + "!");
15+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'use strict'
2+
3+
'use strict'
4+
5+
let books = [{
6+
title : "fifty shades of grey",
7+
author : "E. L. James",
8+
alreadyRead : true
9+
},
10+
{
11+
title : "Safe, Strong, and Streetwise",
12+
author : "Helen Benedict columbia",
13+
alreadyRead : true
14+
},
15+
{
16+
title : "The Opposite of Love ",
17+
author : "Helen Benedict columbia",
18+
alreadyRead : false
19+
}
20+
]
21+
for( let x of books ) {
22+
console.log(x.title+ " by " + x.author);
23+
if (x.alreadyRead === true){
24+
console.log("You already read " + x.title);
25+
}
26+
else {
27+
console.log("You still need to read " + x.title);
28+
}
29+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
let commars = "hello,this,is,a,difficult,to,read,sentence";
4+
console.log(commars.length);
5+
6+
let removeCommars = commars.split(',').join(""); //replace(/,/g, '');
7+
console.log(removeCommars);

0 commit comments

Comments
 (0)