Axel (Rinkusu) – 15-49 Oct 31

Hi, I get minus zeros when doing modulos operations with values from an object. Any idea please ?
const LADY_ORIENTATION = [
{value: -9, orientation: 'topLeft'},
{value: -7, orientation: 'topRight'},
{value: 9, orientation: 'bottomRight'},
{value: 7, orientation: 'bottomLeft'}
]

let orientation

LADY_ORIENTATION.forEach((elem, i) => {
console.log('calc:', SELECTED_POS % elem?.value)
if (SELECTED_POS % elem?.value === 0) {
orientation = LADY_ORIENTATION[i]?.orientation
}
})
console.log('orientation:', orientation)
}
const LADY_ORIENTATION = [
{value: -9, orientation: 'topLeft'},
{value: -7, orientation: 'topRight'},
{value: 9, orientation: 'bottomRight'},
{value: 7, orientation: 'bottomLeft'}
]

let orientation

LADY_ORIENTATION.forEach((elem, i) => {
console.log('calc:', SELECTED_POS % elem?.value)
if (SELECTED_POS % elem?.value === 0) {
orientation = LADY_ORIENTATION[i]?.orientation
}
})
console.log('orientation:', orientation)
}
UU
Unknown User535d ago
L
LaRynk535d ago
it is, so what can I do please ?
UU
Unknown User535d ago