JavaScript 第三天:学习一些 JS 数据类型以及在 JS 中创建和移除元素
1. null: A variable explicitly assigned with no value. It represents "nothing" or "no value". let y = null; console.log(y); // null Use null when you want to intentionally indicate "no...
null表示无值的变量,undefined表示已声明但未赋值的变量。字面量是代码中的固定值,模板字面量使用反引号定义并允许嵌入表达式。使用document.createElement()方法创建元素,添加文本后可通过appendChild()将其添加到DOM中。
