console.log("hello world");
let js = "amazing";
console.log(js);
console.log(40 + 10);
console.log("amzazing");
let firstName = "Octopus";
console.log("FistName:", firstName);
firstName = "Zhangyu";
console.log("FristName:", firstName);
let _function = 27;
let PI = 3.1415;
let myFirstJob = "programmer";
let myCurrentJob = "teacher";
console.log(true);
console.log(null);
console.log(typeof true);
console.log(typeof 123);
console.log(typeof "21");
let secondName = 12;
console.log(typeof secondName);
secondName = "teacher";
console.log(typeof secondName);
let age = 30;
age = 31;
const birthYear = 1991;
var habbit;
habbit = "123";
habbit = 123;
lastName = "Octopus";
console.log(lastName);
const now = 2037;
const ageOctopus = now - 1998;
const ageZy = now - 1998;
console.log(ageOctopus, ageZy);
console.log(ageOctopus * ageZy, ageZy / 2, 2 ** 3);
console.log("KKKK" + "JJJJ")
let x = 10 + 5;
x += 10;
x++;
console.log(x);
console.log(2 > 1);
console.log("1555" > "1456");
const hello = "Hello" + " " + "World " + 2022 + " " + true;
console.log(hello);
const helloTemplate = `${hello}, ${2 - 1}`;
console.log(helloTemplate);
console.log(`"hello world"`);
console.log("hello \n\world");
const ageNow = 19;
const isOldEnough = age >= 18;
if (isOldEnough) {
console.log("can drive 🚗");
} else {
console.log("can not drive 🚗");
}
const inputYear = "1999";
console.log(inputYear + 1)
console.log(Number(1999) + 1)
console.log(typeof NaN)
console.log(String(1999))
console.log(inputYear + 1)
console.log("23" - "10")
console.log(Boolean("octopus"))
console.log(Boolean(undefined))
console.log(Boolean(NaN))
console.log(Boolean("0"))
console.log(Boolean(0))
const lenNow = 3;
if (lenNow === 3) {
console.log(`lenNow is equal ${lenNow}`)
}
if ("3" == 3) {
console.log(`lenNow is equal ${lenNow}`)
}
const inputNum = prompt("input number: ");
if (inputNum === 666) {
console.log(`guess right string!`);
}
if (Number(inputNum) === 666) {
console.log(`guess right number!`);
}
if (Number(inputNum) !== 666) {
console.log(`guess wring number!`);
}
const hasGoodVision = true
const hasDriverLicense = true
console.log(hasDriverLicense && hasDriverLicense)
const speed = 100
switch (speed) {
case 100:
console.log("too fast");
break;
case 102:
console.log("normal speed");
break;
default:
console.log("not running");
break;
}
const color = "blue";
color === "blue" ? console.log("color is blue") : console.log("color is not blue");
const bill = 275;
const tip = bill <= 300 && bill > 50 ? bill * 0.15 : bill * 0.1;
console.log(bill)