add(server.tests.test2): 添加实验2的内容,将pdf里面标重要的进行提取出来
This commit is contained in:
28
Server/tests/test2/important/splice.js
Normal file
28
Server/tests/test2/important/splice.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// splice(start)
|
||||
// splice(start, deleteCount)
|
||||
// splice(start, deleteCount, item1, ...)
|
||||
|
||||
const datas = ["aa", "bb", "cc"];
|
||||
console.log(datas.splice(1))
|
||||
console.log(datas)
|
||||
|
||||
console.log(datas.splice(1, 1))
|
||||
console.log(datas)
|
||||
|
||||
console.log(datas.splice(1, 0, "xx", "yy"))
|
||||
console.log(datas)
|
||||
|
||||
console.log(datas.splice(1, 1, "xx"))
|
||||
console.log(datas)
|
||||
|
||||
/*
|
||||
# node splice.js
|
||||
[ 'bb', 'cc' ]
|
||||
[ 'aa' ]
|
||||
[]
|
||||
[ 'aa' ]
|
||||
[]
|
||||
[ 'aa', 'xx', 'yy' ]
|
||||
[ 'xx' ]
|
||||
[ 'aa', 'xx', 'yy' ]
|
||||
*/
|
||||
Reference in New Issue
Block a user