web-interview icon indicating copy to clipboard operation
web-interview copied to clipboard

我是齐丶先丶森,收集整理全网面试题及面试技巧,旨在帮助前端工程师们找到一份好工作!更多详见公众号「前端面试秘籍」

Results 109 web-interview issues
Sort by recently updated
recently updated
newest added

答案:提供一个在页面上已存在的 DOM 元素作为 Vue 实例的挂载目标.可以是 CSS 选择器,也可以是一个 HTMLElement 实例

VUE

```js [1, 2, 3, 4].reduce((x, y) => console.log(x,y)) ``` ``` A:1 2 and 3 3 and 6 4 B: 1 2 and 2 3 and 3 4 C: 1 undefined...

选择题

```js function getAge(...args) { console.log(typeof args); } getAge(21); ``` ``` A:"number" B: "array" C: "object" D: "NaN" ``` 答案:C 解析: 扩展运算符(...args )返回一个带参数的数组。 数组是一个对象,因此typeof args返回object。

选择题

```js let name = "Lydia"; function getName() { console.log(name); let name = "Sarah"; } getName(); ``` ``` A:Lydia B: Sarah C: undefined D: ReferenceError ``` 答案:D 解析: 每个函数都有其自己的执行上下文。getName 函数首先在其自身的上下文(范围)内查找,以查看其是否包含我们尝试访问的变量 name。上述情况,getName...

选择题

```js let newList = [1, 2, 3].push(4); console.log(newList.push(5)); ``` ``` A:[1,2,3,4,5] B: [1,2,3,5] C: [1,2,3,4] D: Error ``` 答案:D 解析: .push()方法返回数组的长度,而不是数组的本身。

选择题

```js console.log("🐭" + "🐍"); ``` ``` A:🐭🐍 B:257548 C:A string containing their code points D:Error ``` 答案:A 解析: 使用+运算符,您可以连接字符串。上述情况,我们将字符串"🐭" 与 字 符 串 "🐍"连 接 起 来 , 产 生...

选择题

```js const name = "Lydia"; console.log(name()); ``` ``` A:SyntaxError B: ReferenceError C: TypeError D: undefined ``` 答案:C 解析: 变量 name 保存字符串的值,该字符串不是函数,因此无 法调用。 当值不是预期类型时,到抛出 TypeErrors。JavaScript 期望 name 是一个函数,因为我们试图调用它。但它是一个字符串,因此抛出 TypeError : name...

选择题

```js const settings = { username: 'lydiahallie', level: 19, health: 90 }; const data = JSON.stringify(settings, ['level', 'health'] console.log(data); ``` ``` A:"{"level":19, "health":90}" B: "{"username": "lydiahallie"}" C: "{"level", "health"]" D:...

选择题

```js const set = new Set(); set.add(1); set.add("Lydia"); set.add({ name: "Lydia" }); for (let item of set) { console.log(item + 2); } ``` ``` A:3, NaN, NaN B: 3, 7,...

选择题