Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
3
respuestas

Scope of a variable in JavaScript, var vs let.

Just as an additional little contribution to this great project. I think that there´s a little lack in mentioning the usage of a variable declared as var or let, despite that, the concept is really easy to grab. it´s all about the scope of a variable, if you have a little of knowledge about other computer programming languages it´s really easy to see the right usage, otherwise also is really easy to see the right usage of a variable declared as var or let in JavaScript, just use "var" if you think that the variable is going to be needed outside in anyother part of the program or block, and use "let" if that variable is only to be used inside that program block. The key concept on this is the variable scope. Check this link out if you want to rustle through the concept. https://www.analyticslane.com/2019/06/10/diferencias-entre-var-y-let-en-javascript/ Thanks

3 respuestas

Hello Gustavo! What an excellent addition, you are absolutely right it is very important to have this knowledge for the functional paradigm that employs the immutability of which "let" fulfills the correct concept for it. I share your opinion on how important this issue is, because currently the OOP paradigm is no longer used.

Excellent information!!

Hello and good afternoon everyone. Thank you, very much for your input. ¡Very interesting information!.

¡Best regards!