How to check if a number is multiples of 3 and 5 in JavaScript

1 Answer

0 votes
const number = 300;

if (number % 3 === 0 && number % 5 === 0)
    console.log("number is multiple of 3 and 5");
else
    console.log("number is NOT multiple of 3 and 5");
 
 
 
 
/*
run:
 
"number is multiple of 3 and 5"
 
*/

 



answered Jul 28, 2022 by avibootz
...