I want to create a block scoped variable in javascript using var keyword.
I don't want to create using let keyword ecma6. As it will not support all browsers.
Is there a way to achieve this through some best and generic way?
usecase: I want to use this in for loop so that for every iteration it will create a new scope.
.forEach().letorconst. Everything else is only a workaround and most of the time also more complex thanforEach.