Skip to content

字节前端青训营笔试 ​

2023-01-07 20:35:47

  • 解构
js
let [a = 1, b] = []

a = ? b = ?
  • 输出顺序
js
Promise.resolve()
  .then(() => {
    Promise.resolve()
      .then(() => {
        console.log(1)
      })
      .then(() => {
        console.log(2)
      })
  })
  .then(() => {
    console.log(3)
  })

result: 1 3 2

  • 求结果
js
console.log([1, 2, 3, 4, 5].splice(1, 2, 3, 4, 5))

console.log([1, 2, 3, 4, 5].slice(1, 2, 3, 4, 5))

result: [2, 3] [2]

  • 与 HTTP 缓存相关的请求头是:

    • Cache-Control
    • If-Modified-Since
    • If-None-Match
  • 两道算法

      1. 汉字数字转阿拉伯数字
      1. js 输入一个字符串,输出该字符串中字符所有的排列组合 例: abc => abc acb bac bca cab cba

Released under the MIT License.