js中获取余数,取商,一般用于一些特定循环的数据中。
var num = parseInt(4%3); //取余
console.log(num); //1
var num = parseInt (7/3); //取商
console.log(num); //2
js中获取余数,取商,一般用于一些特定循环的数据中。
var num = parseInt(4%3); //取余
console.log(num); //1
var num = parseInt (7/3); //取商
console.log(num); //2