main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const satellite = "The Moon"
const galaxy = "The Milky Way"
const stars = "North Star"

//basic function syntax
function callMyNightSky() {
  return "Night Sky: " + satellite + ", " + stars + ", and " + galaxy;
}
console.log(callMyNightSky())



const fruit = "apples"
const veggie = "asparagus"
const carbs = "bread"

//anonymous function syntax
const whatsForLunch = function() {
  return "My Lunch: " + fruit + ", " + carbs + ", and " + veggie
}

console.log(whatsForLunch())



const sport = "soccer"
const hobby = "knitting"
const talent = "singing"

//arrow function syntax
const callMyLife = () => {
  return "My Life: " + sport + ", " + talent + ", and " + hobby;
}

console.log(callMyLife());
Native Browser JavaScript