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
На этой странице сайта вы можете посмотреть видео онлайн parsetInt() Function in JavaScript - JavaScript Tutorial 17 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ChidresTechTutorials 02 Февраль 2017, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 9,392 раз и оно понравилось 190 зрителям. Приятного просмотра!