#JS from Start- JavaScript Type Conversion
I mentioned that I will be posting on the #Jsfromstart on Tuesday, Thursdays and Saturday, but I could not post last Saturday because I was pretty engaged. So, I am sorry for that. Last time, I talked about the data types which are the primitive and reference. I gave a clear explanation of the two. Today, I will write about Type conversion. It is all about taking a variable and changing the data type. There are situations you would do this and you should know how to do them.
So, let's initiate a variable.
Number to String
I console.log the variable, typeof and the length for strings and I I used toFixed for numbers. The images explains all.
Boolean to String
Date to String
Array to String
The toString() method
String to Number
Boolean to Number
Null to Number
parseInt() Method
parseFloat() Method
Type coercion
That will be it for today, I will talk about Number and Math objects in the next post.
Thank you.
Leave #JS from Start- JavaScript Type Conversion to:
Read more #tutorial posts
Best Posts From tykee
We have not curated any of tykee's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From tykee
- Hive is still beautiful
- The Good n Ugly of Cryptos
- Bug Hunting and Suggestion (70 Hive Bounty)
- Biggest Life Error you can make as a Crypto trader.
- Life and purpose
- My Recent Macbook pro experience.
- Bug Report (a Click on Profile picture)
- Cryptos, My environment and I.
- Some Facts about Cryptocurrency - Add Yours in the comment
- Crypto: Nigerian Govt are bunch of a mess.
- Have a consistent income before dabbling to the crypto space.
- When things fails for too long, change the pattern.
- Successful Cryptocurrency Investing: Wisdom over Wealth
- The 4-Hour Rule for Achieving World-Class Skills
- Why Fundamental Analysis Trumps Technical Analysis in Crypto Trading
- Embrace New Skills for Tomorrow's World
- Easiest way to grow.
- Hey guy
- Crypto Rollercoster (TIME)
- Hey Yoo!