【js】两个数相除有余数时结果加1

var all=15;

var item=2;

var pages=all%item==0?(all/item):(Math.floor(all/item)+1);

console.log(pages)

原文地址:https://www.cnblogs.com/webSong/p/9133018.html