Javascript模块 [英] Javascript modulo
本文介绍了Javascript模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道Javascript如何处理模数。例如,Javascript会评估47%8?谢谢。我似乎无法找到任何文档,我的modulo技能也不是最好的......谢谢!
<正如每种语言处理模数一样: X / Y
的其余部分。
47%8 == 7
另外,如果您使用Firefox + Firebug,Safari ,Chrome甚至IE8 +都可以像F12一样快速测试这样的操作。
I was wondering how Javascript handles modulo. For example, what would Javascript evaluate 47 % 8? Thanks. I can't seem to find any documentation on it, and my skills on modulo aren't the best... Thanks!
解决方案
Exactly as every language handles modulo: The remainder of X / Y
.
47 % 8 == 7
Also if you use a browser like Firefox + Firebug, Safari, Chrome, or even IE8+ you could test such an operation as quickly as hitting F12.
这篇关于Javascript模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文