KiYugadgeter
KiYugadgeter

Reputation: 4032

How can use global let declaration in ES6?

How I can use ES6 global let declaration?

let video = document.getElementById("video");
let button = document.getElementById("controllbutton");

The Above code causes Error that SyntaxError: missing ; before statement on Firefox.

Why above code causes Syntax Error?

Upvotes: 0

Views: 79

Answers (2)

KiYugadgeter
KiYugadgeter

Reputation: 4032

I added type="application/javascript;version=1.7" in script tag, it resolved Syntax Error.

Upvotes: 1

Kip
Kip

Reputation: 558

Are you transpiling? I don't see browser support for FF for this feature: https://kangax.github.io/compat-table/es6/

Upvotes: 1

Related Questions