// First we cut the array from the right of the given number,
// Then we slice it again from the left and we build the new array.
return[...a.slice(d),...a.slice(0,d)];
}
rotLeft([1,2,3,4,5],4)
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.