⚡️parseInt()
and
⚡️Number()
both converts string to number however there is a big difference between both
⚡️ parseInt() reads the string from left to right & stops parsing when it encounters a non-numeric character.
It returns the numeric value parsed up to that point.
example: parseInt("19abc") -> returns 19
⚡️Number() is more strict.
If the string contains any non-numeric characters (except for whitespace), it returns NaN
example: Number(123abc) -> returns NaN
⚡️Also if string is in float then Number() will return float number but parseInt() will only return integer.
example:
parseInt("6.9") -> returns 6 only
Number("18.5") -> returns 18.5
This makes a big impact especially when you are handling data that can have string values as well attached to the number.
In that case use parseInt() other wise use Number().
@javascript_resources #javascript
and
⚡️Number()
both converts string to number however there is a big difference between both
⚡️ parseInt() reads the string from left to right & stops parsing when it encounters a non-numeric character.
It returns the numeric value parsed up to that point.
example: parseInt("19abc") -> returns 19
⚡️Number() is more strict.
If the string contains any non-numeric characters (except for whitespace), it returns NaN
example: Number(123abc) -> returns NaN
⚡️Also if string is in float then Number() will return float number but parseInt() will only return integer.
example:
parseInt("6.9") -> returns 6 only
Number("18.5") -> returns 18.5
This makes a big impact especially when you are handling data that can have string values as well attached to the number.
In that case use parseInt() other wise use Number().
@javascript_resources #javascript
AI for Beginners by Microsoft
Free AI for Beginners Course from Microsoft.
Don't miss it! Course link 👇
Free AI for Beginners Course from Microsoft.
Don't miss it! Course link 👇
🔥1
-Coding is so simple.
-Don't listen to what people say.
-Some will discourage you.
-Some will say it's difficult.
-Try it
-Experience it by yourself,
-Then answer yourself whether it's difficult or simple
-Happy Coding
#motivation
@javascript_resources
-Don't listen to what people say.
-Some will discourage you.
-Some will say it's difficult.
-Try it
-Experience it by yourself,
-Then answer yourself whether it's difficult or simple
-Happy Coding
#motivation
@javascript_resources
👍3🔥2❤1
4 Harsh Truths About Life
1. Relationships that come naturally are the strongest
2. You can not reach all your goals
3. You can not know everything, although you should
4. You need to sacrifice yourself to make the world care about you
@javascript_resources
#motivation
1. Relationships that come naturally are the strongest
2. You can not reach all your goals
3. You can not know everything, although you should
4. You need to sacrifice yourself to make the world care about you
@javascript_resources
#motivation
❤2
Top 10 best docs you can read in 2024 as a software developer 👨💻👩💻. 👇
-Python Documentation 🐍
-JavaScript MDN Docs 📚
-React Official Documentation ⚛️
-Django Documentation 🌐
-Vue.js Guide 🖖
-Git Documentation 🔄
-SQLAlchemy Documentation 🛠️
-TensorFlow API Docs 🤖
-Java API Documentation ☕
-Docker Documentation 🐳
-Python Documentation 🐍
-JavaScript MDN Docs 📚
-React Official Documentation ⚛️
-Django Documentation 🌐
-Vue.js Guide 🖖
-Git Documentation 🔄
-SQLAlchemy Documentation 🛠️
-TensorFlow API Docs 🤖
-Java API Documentation ☕
-Docker Documentation 🐳
👍2
🔟 Essential Shortcuts in Visual Studio Code:
💾 Save: Ctrl + S
↩️ Undo: Ctrl + Z
🔁 Redo: Ctrl + Y
✂️ Cut: Ctrl + X
📋 Copy: Ctrl + C
📄 Paste: Ctrl + V
🔍 Find: Ctrl + F
🔄 Replace: Ctrl + H
📜 Go to Line: Ctrl + G
📂 Toggle Sidebar: Ctrl + B
🌐 Toggle Full Screen: F11
to open the terminal Ctrl + `
💾 Save: Ctrl + S
↩️ Undo: Ctrl + Z
🔁 Redo: Ctrl + Y
✂️ Cut: Ctrl + X
📋 Copy: Ctrl + C
📄 Paste: Ctrl + V
🔍 Find: Ctrl + F
🔄 Replace: Ctrl + H
📜 Go to Line: Ctrl + G
📂 Toggle Sidebar: Ctrl + B
🌐 Toggle Full Screen: F11
to open the terminal Ctrl + `
👍1
Learn JavaScript by playing games🚀👇🏻
1. CodeCombat
➩ https://codecombat.com
2. Screeps
➩ https://screeps.com
3. Code Wars
➩ https://codewars.com
4. JS Robot
➩ https://lab.reaal.me/jsrobot/
5. Untrusted
➩ https://alexnisnevich.github.io/untrusted/
1. CodeCombat
➩ https://codecombat.com
2. Screeps
➩ https://screeps.com
3. Code Wars
➩ https://codewars.com
4. JS Robot
➩ https://lab.reaal.me/jsrobot/
5. Untrusted
➩ https://alexnisnevich.github.io/untrusted/
CodeCombat
CodeCombat: Learn to Code by Playing a Game
Learn programming with a multiplayer live coding strategy game for beginners. Learn Python or JavaScript as you defeat ogres, solve mazes, and level up. Open source HTML5 game!