Notes for You:: JavaScript parseInt(value) function:
Converts a given value to an integer number, if not possible then it returns NaN value
Case 1:
If the given value is of integer type, then it returns number as it is.
Example Code:
document.write( parseInt(24) ); // 24
document.write(parseInt(12+12)); // 24
Case 2:
If the given value is of float type, then it discards the float part and returns integer part of the number.
Example Code:
document.write(parseInt(3.142)); // 3
document.write(parseInt(1.6+1.6)); // 3
Case 3:
If the given value is of string type, then it tries to extract and return the beginning integer part.
If string passed to the parseInt function does not begin with integer then it returns NaN value.
Example Code:
document.write(parseInt("24")); // 24
document.write(parseInt("3.142")); // 3
document.write(parseInt("24sometext")); // 24
document.write(parseInt("2"+"4")); // 24
document.write(parseInt("2"+"4a")); // 24
document.write(parseInt("2a"+"4a")); // 2
document.write(parseInt("sometext24")); // NaN
=========================================
Follow the link for next video:
JavaScript Tutorial 18 - parseFloat() Function in JavaScript | JavaScript parseFloat()
• parseFloat() Function in JavaScript -...
Follow the link for previous video:
JavaScript Tutorial 16 - Type Casting in JavaScript | JavaScript Type Conversions
• Type Casting in JavaScript - JavaScri...
=========================================
JavaScript Tutorials Playlist:-
• JavaScript Tutorials
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
• jQuery Tutorials
jQuery UI Tutorials Playlist:-
• jQuery UI Tutorials
Bootstrap Tutorials Playlist:-
• Bootstrap4 Tutorials
=========================================
► Subscribe to our YouTube channel:
/ chidrestechtutorials
► Visit our Website:
https://www.chidrestechtutorials.com
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
On this page of the site you can watch the video online parsetInt() Function in JavaScript - JavaScript Tutorial 17 with a duration of hours minute second in good quality, which was uploaded by the user ChidresTechTutorials 02 February 2017, share the link with friends and acquaintances, this video has already been watched 9,392 times on youtube and it was liked by 190 viewers. Enjoy your viewing!