Introduction to the use of parseInt of methods for global objects in javascript

  • 2020-03-30 01:00:56
  • OfStack

 
<html> 
<head> 
<title> Global object's parseInt()  methods </title> 
<script> 
 
document.write(parseInt("123") + "<br/>");//123 
document.write(parseInt("1abc23") + "<br/>");//1 
document.write(parseInt("123abc") + "<br/>");//123 
document.write(parseInt("abc") + "<br/>");//NaN 
document.write(parseInt("100",2) + "<br/>");//4, parse in binary form
document.write(parseInt("123",2));//One, because two and three don't resolve
</script> 
</head> 
<body> 
<div id="time"></div> 
</body> 
</html> 

Related articles: