Skip to content

Commit c829435

Browse files
committed
Merge branch 'week3-Amirhossein' into master
2 parents fd9589f + 8f026b3 commit c829435

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict'
2+
function giveCompliment(name) {
3+
const compliments = ["great", "amazing", "wonderful", "lamentable", "attractive", "merciful", "fair" , "spectacular", "dynamic", "elegant"];
4+
const randCompliment = compliments[Math.floor(Math.random() * compliments.length)];
5+
6+
return `You are ${randCompliment}, ${name}!`; //I've tried to use "return" without console.log but it didn't return anything! Why?
7+
};
8+
// giveCompliment('ali')
9+
const x = giveCompliment('ali');
10+
const y = giveCompliment('ali');
11+
const z = giveCompliment('ali');
12+
console.log(x);
13+
console.log(y);
14+
console.log(z);

0 commit comments

Comments
 (0)