Open this example in the interactive library
Source code
const bearing = -35;
console.log(((bearing % 360) + 360) % 360);
Sample output
325

Open this example in the interactive library
const bearing = -35;
console.log(((bearing % 360) + 360) % 360);
325