Rumah > Artikel > hujung hadapan web > jsBasics_Practice
let str1 = 'Laurence'; console.log(typeof (str1)); //string let str2 = "Svekis"; console.log(typeof (str2)); //string let val1 = undefined; console.log(typeof (val1)); //undefined let val2 = null; console.log(typeof (val2)); //object let myNum = 1000; console.log(typeof (myNum)); //number
const c = "5"; //string const d = 91; // number
let empty1 = undefined; //line 1 let empty2 = null; //line 2
let a1 = "Hello"; a1 = "world"; console.log(a1); //world
let a2 = "world"; let b2 = Hello ${a2}!; console.log(b2); // Helloworld
let a4 = 5; let b4 = 70; let c4 = "5"; b4++; console.log(b4); //71
biar keputusan = 3 4 * 2 / 8; // 4, tidak mencetak apa-apa kerana kami tidak mencatatkan hasilnya.
let firstNum = 5; let secondNum = 10; firstNum++; secondNum--; let total = ++firstNum + secondNum; console.log(total); //16 let total2 = 500 + 100 / 5 + total--; console.log(total2); // 536
const a = 5; const b = 10; console.log(a > 0 && b > 0); // true console.log(a == 5 && b == 4); // false console.log(true || false); // true console.log(a == 3 || b == 10); // true console.log(a == 3 || b == 7); // false
"Epal". Semak panjang senarai anda dalam konsol. Kemas kini "Roti" kepada "Pisang". Keluarkan keseluruhan senarai anda ke konsol.
Atas ialah kandungan terperinci jsBasics_Practice. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!