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
Sur cette page du site, vous pouvez voir la vidéo en ligne parsetInt() Function in JavaScript - JavaScript Tutorial 17 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur ChidresTechTutorials 02 février 2017, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 9,392 fois et il a aimé 190 téléspectateurs. Bon visionnage!