issues Search Results · repo:Advanced-Frontend/Daily-Interview-Question language:JavaScript
Filter by
566 results
(122 ms)566 results
inAdvanced-Frontend/Daily-Interview-Question (press backspace or delete to remove)h2 strong Introduction to Daily Horoscope /strong /h2 h3 span style= font-weight: 400; What is a Daily Horoscope? /span
/h3 p span style= font-weight: 400; A /span strong daily horoscope /strong span style= ...
sgvedicmeet
- Opened 17 days ago
- #597
function getIndex(nums) {
let min = Infinity
let index = -1
for (let i = 0; i nums.length; i++) {
if (nums[i] 0 nums[i] min) {
min = nums[i]
index = i
}
}
return ...
xiao-tiger
- 1
- Opened on Jun 24
- #596
var arr = [[1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 9, [11, 12, [12, 13, [14]]]], 10]; let fn = (arr) = { let res = [] for
(let i = 0; i arr.length; i++) { if (typeof arr[i] === number ) { res.push(arr[i]) } ...
cute-baobao
- Opened on Apr 12
- #595
const array1 = [ A1 , B1 , A2 , B2 , C1 , C2 , D1 , D2 ].sort(); const array2 = [ A , C , B , D ].sort(); const result =
[];
for (let i = 0; i array2.length; i++) { result.push(array1[2 * i], array1[2 ...
jotarochen
- Opened on Apr 1
- #594
我使用Chrome打印为
{
2 : 1,
3 : 2,
length : 4
}
分析:
1. push 方法的行为: Array.prototype.push 方法根据对象的 length 属性决定插入位置。调用 push 时,元素会被添加到索引 length 处,并将 length 加 1。
2. 第一次 push(1): 初始 length 为 2,元素 ...
wjc7jx
- Opened on Mar 12
- #593
const arr = [10, 21, 0, -7, 35, 7, 9, 23, 18] var pos = 0 var num = arr[0] for (var i = 1; i arr.length; i++) { if
(arr[i] 0 arr[i] num) { num = arr[i] pos = i } } return pos
zhangzhangjing
- Opened on Mar 11
- #592
const fn = (num) = { const res = [] let i = 1 const temp = Math.ceil(num.toString().split( ).length / 2) let maxNum =
Number(1${[...Array(temp).keys()].map(i = 0 ).join( )}) const reverseFn = (n) = n.toString().split( ...
yuewanxinghui
- Opened on Oct 21, 2024
- #591
const fn = function(str){ let arr = str.split( ) let obj = {} let maxStr = , maxNum = 0; arr.reduce((pre, next) = {
if(pre in obj){ if(pre == next) obj[pre]++ }else{ obj[pre] = 1 } return next },arr[0]) ...
DingSJi
- Opened on Aug 27, 2024
- #590
` Object.prototype.map = function(callback){ if(typeof callback !== function ){ throw new TypeError( param must be a
Function ) } const newObj = {} for(const key in this){ if(this.hasOwnProperty(key)){ ...
luo29
- Opened on Mar 29, 2024
- #589
setTimeout 定时器,可以延迟执行,属于宏任务,在JavaScript事件循环中,执行优先级最低。 Promise 本身是同步的立即执行函数, 当在executor中执行resolve或者reject的时候, 此时是异步操作,
会先执行then/catch等,当主栈完成后,才会去调用resolve/reject中存放的方法执行,打印p的时候,是打印的返回结果,一个Promise实例。resolve函数的作用是,将Promise对象的状态从“未完成”变为“成功”(即从 ...
codewycat
- Opened on Aug 26, 2023
- #588

Learn how you can use GitHub Issues to plan and track your work.
Save views for sprints, backlogs, teams, or releases. Rank, sort, and filter issues to suit the occasion. The possibilities are endless.Learn more about GitHub IssuesProTip!
Press the /
key to activate the search input again and adjust your query.
Learn how you can use GitHub Issues to plan and track your work.
Save views for sprints, backlogs, teams, or releases. Rank, sort, and filter issues to suit the occasion. The possibilities are endless.Learn more about GitHub IssuesProTip!
Press the /
key to activate the search input again and adjust your query.