Faaaah (copy to edit)
This commit is contained in:
32
lab1/temp.js
Normal file
32
lab1/temp.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// const arr = [1, 2, 3, 4, 5];
|
||||
// const replaced = arr
|
||||
// replaced.splice(2,1,100)
|
||||
// const removed = [...replaced];
|
||||
// removed.splice(3,1);
|
||||
// const updated = [...removed];
|
||||
// updated.splice(3,0,200);
|
||||
// console.log(updated);
|
||||
|
||||
const arr = [2, 2, 4, 1, 6, 12]
|
||||
|
||||
// const ret = arr.map((val, i, array) => {
|
||||
|
||||
// return array.slice(Math.max(0, i - 1), Math.min(array.length - 1, i + 2)) /
|
||||
// (Math.max(0, i - 1)-Math.min(array.length - 1, i + 1))
|
||||
// })
|
||||
|
||||
// console.log(ret)
|
||||
|
||||
// let min = arr.reduce((acc,x)=>x<acc?x:acc);
|
||||
// console.log(min)
|
||||
|
||||
|
||||
|
||||
|
||||
function groupArr(func,...args){
|
||||
return args.reduce(func)
|
||||
}
|
||||
|
||||
|
||||
|
||||
const users =
|
||||
Reference in New Issue
Block a user