Issues with indexOf and splice (resolved)

let list = [1, 2, 3]
list.splice(list.indexOf(2), 1)
// [1]
console.log(list)

and

let list = [1, 2, 3],
    idx = list.indexOf(2)
list.splice(idx, 1)
// [1, 3]
console.log(list)
What"s the difference between

?

tried several more times, but there was no difference. Maybe there was something wrong with the execution before.

Apr.11,2021
There is no difference between

. Besides, the output of the above code is also [1Jing 3]

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e6287e-459ba.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e6287e-459ba.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?