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
En esta página del sitio puede ver el video en línea parsetInt() Function in JavaScript - JavaScript Tutorial 17 de Duración hora minuto segunda en buena calidad , que subió el usuario ChidresTechTutorials 02 febrero 2017, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 9,392 veces y le gustó 190 a los espectadores. Disfruta viendo!