Hi, you have said that variable declared as var will have global scope if declared outside a function. But the same can even be said for variables declared as let and const. They indeed are locally scoped but when done outside a function, they will have global scope like var.
Please correct me if am wrong?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, you have said that variable declared as var will have global scope if declared outside a function. But the same can even be said for variables declared as let and const. They indeed are locally scoped but when done outside a function, they will have global scope like var.
Please correct me if am wrong?