-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
46 lines (36 loc) · 989 Bytes
/
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
var idname = "patrick";
let age = 34;
const title = "backend dev";
idname = "chisom";
age = 48;
// title = "DevOps";
// console.log(idname);
// console.log(age);
// console.log(title);
// Numbers
let weight = 75; // kg - integer
let height = 123.5; // cm - float
// strings
let car = "toyota"
// boolean
let isTall = true
let isShort = false
// object
let bikeOne = { color: "blue", brand: "lexus", speed: 200 }
// console.log(bikeOne.brand)
bikeOne.brand = "toyota"
// console.log(bikeOne.brand)
let bikeBrands = { date: 1997, bike: bikeOne }
// console.log(bikeBrands.date)
// console.log(bikeBrands.bike.brand)
// console.log(bikeBrands.bike.color)
// Arrays
let cars = ["toyota", "honda", "hyundai", "sakura", 6, true]
// console.log(cars)
// console.log(cars[2]) // hyundai
// console.log(cars[4]) // number 6
console.log(cars.length)
console.log(cars[cars.length - 1])
console.log(cars.slice(-1))
// some new code - @josh
console.log("this is a newly added line of code")