1. `console.log(typeof typeof typeof null);` 打印出什么结果 string
typeof null => object
typeof object => string
typeof string => string
2. `'abcdcba'.replace(/c/, "h");` 返回什么结果 'abhdcba'
3. 元素 p 内的文字最终什么颜色 blue
```html
<style>
.classA { color:blue; }
.classB { color:red;}
</style>
<p class="classB classA">hello</p>
-
a 输出的内容是什么
var a = 1; function fn() { console.log(a); ar a = 2; } fn();
-
data 会输出么,如果会输出内容是什么,不会输出请说明原因 不会输出
Promise.resolve('123') .then(() => throw new Error('456')) .catch((e) => console.log(e))) .then((data) => console.log(data));
-
如下代码输出什么 ‘456’
var name = '123'; var obj = { name: '456', getName: function () { function printName () { console.log(this.name); } printName(); } } obj.getName();
-
如下代码输出什么;
var a = { x: 1 }; var b = a; a.x = 2; a = { n: 1 }; console.log(a); // a:{ n : 1} console.log(b); // b:{ x : 2}
-
如下代码输出什么;
var count = 10; function a() { return count + 10; } function b() { var count = 20; return a(); } console.log(b()); // 20
-
写出 1 2 的打印顺序,并说明代码的执行过程
setTimeout(() => { setTimeout(() => { console.log(1); }, 0); }, 0); setTimeout(() => { console.log(2); }, 100);