Jump to content

let vs var keyword?


ShotgunJed
 Share

Recommended Posts

3 minutes ago, rgk said:

Read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let

http://www.jstips.co/en/javascript/keyword-var-vs-let/

You can use let with phaser and html5 gamedev, but it is es6 so be sure to use babel or only develop for newer browsers.

So to maximise the amount of supported browsers, var should be used instead?

Link to comment
Share on other sites

46 minutes ago, ShotgunJed said:

So to maximise the amount of supported browsers, var should be used instead?

You only want 'var' in the deployed code, you can use const and let in dev and then transpile with babel to convert the code to es5. Depending on which es6 features you use and which browsers you want to support it is getting to the point where transpiling may soon no longer always be necessary though

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...