-4

I am new, I would like to use JSBin for working the console log next to my code would be great!.

let x = 5;
var y = 10; 

console window:

x is undefined

y=10

I would like to use all ES6 in my Javascript. I tried the babel/ES6 but this doesn't work either? What up JSBin??? Sorry for my newbie question.

Community
  • 1
  • 1
  • Possible duplicate of [Do let statements create properties on the global object?](https://stackoverflow.com/questions/28776079/do-let-statements-create-properties-on-the-global-object) – Sterling Archer Oct 02 '17 at 19:51
  • 1
    How do you read them to the console? What is the full code? – epascarello Oct 02 '17 at 19:53

1 Answers1

0

Just click on JavaScript button at the top of your workspace and change it to ES6 / Babel. That should do the trick. Check my snippet on JS Bin over there.

Basically it should work out of the box, but it all depends on your browser.

If you are trying to print that variable by typing it in the console, then you won't be able to do that because:

let and const declarations define variables that are scoped to the running execution context’s

Mateusz Woźniak
  • 1,479
  • 1
  • 9
  • 10