const and let are allowed as declaring variables, except for var, in modified JavaScript. var is used to declare a variable, but you can redeclare it with this. You can use var with something like:
var jello = 3
var jello = 5
console.log(jello)
const and let work similarly, but you cannot redeclare, only change the value, but with const, you cannot change the value and redeclare it. Here is an example:
let jello = 5
console.log(jello)
let jello = 3 // Returns an error: Cannot redeclare block-scoped variable 'jello'.
const drink = 9
drink = 3 // Returns an error: Cannot assign to 'drink' because it is a constant or a read-only property.
But here’s the big question: why does MakeCode’s JavaScript never accept var? I was wondering if they were useless, but I think it makes it less flexible, which is problematic. Any ideas, guys?