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
In questa pagina del sito puoi guardare il video online parsetInt() Function in JavaScript - JavaScript Tutorial 17 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato ChidresTechTutorials 02 febbraio 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 9,392 volte e gli è piaciuto 190 spettatori. Buona visione!