LaRynk
LaRynk3y ago

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)
}
4 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
LaRynk
LaRynkOP3y ago
it is, so what can I do please ?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
reactibot
reactibot3y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1036668267068145776