loading
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
function cat(name) {
  return "Meow my name is " + name + "!"
}

console.log(cat("Gia"))

//Square

function square(x) {
  return x * x;
}

console.log(square(7))

function isEven(x) {
  if (x % 2 === 0) {
    return true
  } else {
    return false
  }

}

console.log(isEven(30))

function isEven(x) {
  return x % 2 === 0

}

console.log(isEven(30))

// Write function odd

console.log(isOdd(35))

function isOdd(x) {
  return x % 2 !== 0

}

// fizz buzz;
// if the number is divisible by 3 return "fizz";
// if

function fizzbuzz(x) {
  if (x % 5 === 0 && x % 3 === 0) {
    return "fizzbuzz"
  }

  if (x % 3 === 0) {
    return "fizz"
  }
  if (x % 5 === 0) {
    return "buzz"
  }


}

console.log(fizzbuzz(5))


function ibw(gender, height) {
  if (gender === "male") {
    if (height <= 60) {
      return 106;
    } else {
      var additional = height - 60;
      return additional * 6 + 106;
    }
  }
  if (gender === "female") {
    if (height <= 60) {
      return 106;
    } else {
      var additional = height - 60;
      return additional * 5 + 100;
    }
  }
}

console.log(ibw("male", 71))

var mike = {
  isPerson: true,
  likesCats: true,
  catsName: ["Peter", "Parker"],
  age: 46,
  sayHello: function(){
    console.log("Hello my name is mike and icu.re")
  }
}

console.log(mike.age)

mike.sayHello();
Fetching token