📝 字数:working on
Variables and Strings¶
Estimated time to read: 1 minute
Concepts¶
Introduction to JavaScript¶
-
HTML provides structure, CSS adds styling, and JavaScript enables behavior, creating a complete and interactive web experience.
-
A data type is the kind of value you store.
-
Number
-
Infinity
-
NaN
-
-
String
-
Boolean
-
undefined
-
null: a special type of Object,
let exampleVariable = null; console.log(typeof exampleVariable); // "object" -
Object: collection of key-value pairs
-
Symbol: unique and immutable
-
BigInt
-
ASI: Automatic Semicolon Insertion
Code¶
let _$aGeFrom = 25; // initialization
age = 30; // reassignment
const immutable = value;
const sentenceStr = "can't change by index, alter";
let sentenceStrM = "can resign";
sentenceStrM = "resign";
// string concatenation: +, +=, concat()
let result = str1.concat(' ', str2);
// typeof operator
console.log(typeof num);