1.

By default JavaScript displays the numbers as ___________(a) base 16(b) base 10(c) base 6(d) base 2The question was asked during an interview.My doubt stems from Essential JavaScript and jQuery in chapter HTML Tables, Javascript & Jquery Basics of HTML

Answer»

Correct choice is (b) BASE 10

The best I can explain: base 10 decimals are displayed as numbers by default by JAVASCRIPT. We can use toString() method for converting numbers as any of the base among 16, 2, 8. E.g var NUMBER= 1256; number.toString(6); number.toString(16); number.toString(2).



Discussion

No Comment Found

Related InterviewSolutions