Skip to content

Commit c7f91eb

Browse files
helpful examples added
1 parent 1774f1a commit c7f91eb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Examples/callstack_example.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function takeShower(){
2+
return "Showering!"
3+
}
4+
5+
function eatBreakfast(){
6+
let meal = cookFood()
7+
return `Eating ${meal}`
8+
}
9+
10+
function cookFood(){
11+
let items = ["Oatmeal", "Eggs", "Protein Shake"]
12+
return items[Math.floor(Math.random()*items.length)];
13+
}
14+
function wakeUp() {
15+
takeShower()
16+
eatBreakfast()
17+
console.log("Ok ready to go to work!")
18+
}
19+
20+
wakeUp()

0 commit comments

Comments
 (0)