Public
Edited
Dec 29, 2022
Insert cell
Insert cell
{

const [first,second, ...rest] = [1,2,3,4,5]


return first
}
Insert cell
{

const acc = [1,3,3,4,5]

return [...acc, 6]
}
Insert cell
{


const start = 0,
array = [1,2,3],
zip = (acc, cur) => {
acc[acc.length-1].push(cur)
return [...acc, [cur]]
},

moves = array.reduce(zip, [[start]])
moves.slice(0)
return moves.slice(0,moves.length-1)
}
Insert cell
game = ({
players:[1,{name: 2},3]
})
Insert cell
{

const p = {...game.players[1]}
p.name = "g"
return p
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more