Does (%) have a higher precedence than ( * ) in javascript ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does (%) have a higher precedence than ( * ) in javascript ?

18th Jan 2022, 12:40 PM
Mohammed
3 Answers
+ 5
No, both operators have same precedence. They are just evaluated from left to right. 6*4%5 = 4 6%4*5 = 10
18th Jan 2022, 1:22 PM
Simba
Simba - avatar
+ 2
According to this table, * / and % shares common precedence, they are on same level of precedence (priority). http://www.scriptingmaster.com/javascript/operator-precedence.asp
18th Jan 2022, 1:21 PM
Ipang
+ 2
Simba Ipang Thank you
18th Jan 2022, 1:24 PM
Mohammed