GoComet interview question

what is the difference between var and let

Interview Answers

Anonymous

10 Mar 2021

var variables can be updated and re-declared within its scope. let variables can be updated but not re-declared

1

Anonymous

10 Mar 2021

var variables are initialized with undefined, let and const variables are not initialized. While var and let can be declared without being initialized, const must be initialized during declaration.

Anonymous

27 Oct 2022

Var have a function scope and let have a block scope