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

```js const set = new Set([1, 1, 2, 3, 4]); console.log(set); ``` ``` A:[1,1, 2, 3, 4] B: [1,2, 3, 4] C: {1,1, 2, 3, 4} D: {1, 2, 3,...

选择题

```js function* generatorOne() { yield ['a', 'b', 'c']; } function* generatorTwo() { yield* ['a', 'b', 'c']; } const one = generatorOne() const two = generatorTwo() console.log(one.next().value) console.log(two.next().value) ``` ``` A:a...

选择题

```js function sum(numl, num2 = numl) { console.log(numl + num2) } sum(10) ``` ``` A:NaN B: 20 C: ReferenceError D: undefined ``` 答案:B 解析: 您可以将默认参数的值设置为函数的另一个参数,只要另一个参数定义在其之前即可。我们将值10传递给sum函数。如果sum函数只接收1个参数,则意味看没有传递 num2 的 值 . 这...

选择题

```js const person = { name: 'Lydia', age: 21 } let city = person.city city = 'Amsterdam' console.log(person) ``` ``` A:{ name: "Lydia", age: 21} B: { name: "Lydia", age:...

选择题

```js var status = '🐰' setTimeout(() => { const status = '🐎' const data = { status: '🐍' getStatus() { return this.status } } console.log(data.getStatus()) console.log(data.getStatus.call(this)) }, 0) ``` ```...

选择题

```js const name = 'Lydia' console.log(name()) ``` ``` A:SyntaxError B: ReferenceError C: TypeError D: undefined ``` 答案:C 解析: 变量name保存字符串的值,该字符串不是函数,因此无法调用。 当值不是预期类型时,到抛出TypeErrors。JavaScript期望name是一个函数,因为我们试图调用它。但它是一个字符串,因此抛出TypeError : name is not a function 当你编写了一些非有效的JavaScript时,会拋出语法错误,例如当你把return这个词写成retrun时。当Script无法找到您尝试访问的值的引用时,抛出ReferenceErrors

选择题

```js String.prototype.giveLydiaPizza = ( ) = > { return 'Just give Lydia pizza already!'; }; const name = 'Lydia'; name.giveLydiaPizza(); ``` ``` A:"Just give Lydia pizza already!" B: TypeError: not...

选择题

```js const { name: myName } = { name:'Lydia'} console.log(name) ``` ``` A:"Lydia" B: "myName" C: undefined D: ReferenceError ``` 答案:D 解析: 当我们从右侧的对象解构属性name时,我们将其值Lydia分配给名为myName的变量。 使用{name: myName},我们是在告诉JavaScript我们要创建一个名为myName的新变量,并且其值是右侧对象的name属性的值。 当我们尝试打印name,一个未定义的变量时,就会引发 ReferenceError

选择题

```js function bark() { console.log('Woof!'); } bark.animal - 'dog'; ``` ``` A:Nothing, this is totally fine! B: SyntaxError. You cannot add properties to a function this way. C: undefined D:...

选择题

```js let a = 3; let b = new Number(3) let c = 3; console.log(a == b); console.log(a === b); console.log(b === c); ``` ``` A:true false true B: false...

选择题