import{_ as s,o as a,c as n,a as l}from"./app.ab8d0b9f.js";const A=JSON.parse('{"title":"【字节跳动】前端面试题总结","description":"","frontmatter":{},"headers":[{"level":2,"title":"看代码说结果","slug":"看代码说结果","link":"#看代码说结果","children":[{"level":3,"title":"代码输出结果1","slug":"代码输出结果1","link":"#代码输出结果1","children":[]},{"level":3,"title":"代码输出结果2","slug":"代码输出结果2","link":"#代码输出结果2","children":[]},{"level":3,"title":"代码输出结果3","slug":"代码输出结果3","link":"#代码输出结果3","children":[]},{"level":3,"title":"代码输出结果4","slug":"代码输出结果4","link":"#代码输出结果4","children":[]},{"level":3,"title":"代码输出结果5","slug":"代码输出结果5","link":"#代码输出结果5","children":[]},{"level":3,"title":"代码输出结果6","slug":"代码输出结果6","link":"#代码输出结果6","children":[]},{"level":3,"title":"代码输出结果7","slug":"代码输出结果7","link":"#代码输出结果7","children":[]}]},{"level":2,"title":"问答题","slug":"问答题","link":"#问答题","children":[{"level":3,"title":"HTTP缓存的请求头与响应头有哪些","slug":"http缓存的请求头与响应头有哪些","link":"#http缓存的请求头与响应头有哪些","children":[]},{"level":3,"title":"宏任务与微任务有哪些区别?简述他们的应用场景","slug":"宏任务与微任务有哪些区别-简述他们的应用场景","link":"#宏任务与微任务有哪些区别-简述他们的应用场景","children":[]}]},{"level":2,"title":"算法","slug":"算法","link":"#算法","children":[]}],"relativePath":"article/【字节跳动】前端面试题总结.md","lastUpdated":1679578423000}'),p={name:"article/【字节跳动】前端面试题总结.md"},e=l(`
console.log(['1', '2', '3'].map(parseInt))
[1, NaN, NaN]
let [a = 1, b] = []
console.log(a, b)
1 undefined
Promise.resolve()
.then(() => {
Promise.resolve()
.then(() => {
console.log(1)
})
.then(() => {
console.log(2)
})
})
.then(() => {
console.log(3)
})
1 3 2
const obj = { 3: '3', 2: 2, 1: '1', name: 'name', age: 'age' }
console.log(Object.keys(obj))
['1', '2', '3', 'name', 'age']
let myArray = {}
myArray['0'] = 'a'
myArray['1'] = 'b'
myArray.length = 2
console.log(...myArray)
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))
[2, 3]
[2]
console.log([].constructor === Array)
console.log(typeof [] === 'array')
console.log(typeof null === 'object')
console.log('' instanceof Object)
true
false
true
false
宏任务与微任务优先级不同
常见的宏任务与微任务
script
setTimeout
setInterval
postMessage
MessageChannel
setImmediate (NodeJS)
Promise.then
Object.observe
MutationObserver
process.nextTick (NodeJS)
中文数字转为阿拉伯数字
给定一个字符串,返回该字符串的所有组合
输入 abc
输出 ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']
回溯算法
`,36),o=[e];function r(c,t,i,y,D,C){return a(),n("div",null,o)}const d=s(p,[["render",r]]);export{A as __pageData,d as default};