I hate intros but we must have one 🤷
Before 2015 javascript developers used to use var as the keyword to declare variables, and life was easy, but...
For further actions, you may consider blocking this person and/or reporting abuse
const
till you can't is my rule. Simple and works well for me :)A good starting thought, except you will run out of generic namespaces like
key
orname
very soon 😂. So the thinking behind “should Iconst
it?”, should be whether is it generic? If so, uselet
overconst
.my other convention is to never allow generic namespaces haha . My code is scattered with long descriptive variable names.
Actually so are mine. I tend to be a little verbose.
However, I'm quite drawn by Ryan Dahl's (guy behind Node and Deno) style.
So nowadays I'm a little bit of both.
The other trick I learnt is that your eyes can read text with missing characters in-between, as long as the start and the end characters remains the same. So you can start to shorten using this trick.
var nvrAllow, gnrcNmspaces
i loved the rhythm 😃
a huge portion in the community agrees on the same,
but i believe in making it more flexible as for some use cases variables are made to be updated, and for newbies, I am not sure if it is easy to know when you cannot form the early start,
but after all, i totally agree
I agree it's weird learning curve for newbies. I also enforce this convention with ESLint
no-const-assign
. This means that whenever I try to reassign aconst
, my linter will remind me to convert it to alet
.see the following - eslint.org/docs/rules/no-const-assign
oh🤩,
i have not tried that before,
it looks handy,
thanks for sharing🙏
Agree.
Wow,that's amazing Nagwan, thanks a lot
I want to know more about npm,npx, yarn if you write about this it will be so nice
thanks for your feedback,
sure as soon as i can
Way to go Nagwan 🎉🎉
It's very useful as you have used some examples that we find in our daily work.
I think it will be great if you can give us a brief about the data types in javascript.
Hope the best for you and waiting you coming interesting articles
thank u Moatasem for the feedback,
and for the data types article, i will as soon as i can
Great demonstration of
var
vslet
/const
. I remember getting asked in a couple interviews about the difference, I wish I could reproduce an example as clear as this one back then.chances never end😉,
just be ready for the next one💪
if want any topic to be discussed here u can suggest it
And not forgetting the best that
let
has done is to solve nested looping:for(let i=0; i<100; i++) { for(let i=0; i<500; I++) {}}
Where before you would need to be using i, j, k... until if you have complicated loops with conditionals, you won’t even know if it has conflicted.
this is one of the most common interview questions,
thanks for mentioning that,
i wanted to add this section, but i wanted the article to be as concise as I could,
thank u
Good job 👍👍
thank you
Nice article and direct to the point,
If you write about closures I will be grateful
Keep it up
it is gonna be the next article,
thanks for your feedback
Great
thanks
Nice article.
Thanks
hope it helps,
thank u for the feedback
A simple and clear explanation, thank you for this article
thanks for the feedback
Great article Nagwan Keep it up
Very straight forward and got the point easily.
Focus on scoping part to elaborate the concept and the difference is brilliant
👏👏👏
thanks, Saied, I am really grateful for your kind words 🥰
Clear and detailed explanation, you make it like a story
Great! Keep going..
thank you
great article