In this custom code we have created a range from 150 to 210 which became an array. Afterwards we wanted to check whether a specific value is included in the previously created array but even though the value is clearly in the created array the includes() returns false. I cannot figure out why this is the case, could you please help me out with this?
function range(start, end, step = 1) {
const len = Math.floor((end - start) / step) + 1
return Array(len).fill().map((_, idx) => start + (idx * step))
}
let sliderInterval = [];
sliderInterval.push(range(180 - 30,180 + 30,5))
console.log(sliderInterval.includes(180));