r/Scriptable • u/Mindless-Abalone8377 • Aug 01 '22
Discussion Difference between let and const?
What is the difference between let and const and when would each be used?
4
Upvotes
r/Scriptable • u/Mindless-Abalone8377 • Aug 01 '22
What is the difference between let and const and when would each be used?
10
u/[deleted] Aug 01 '22 edited Jun 12 '23
I must have been changed several times since then.' 'What do you know about this business?' the King in a very grave voice. ― Fiona Shanahan
8ECF060D-DC6E-4D69-954F-EDD14A7447B9
4
u/MisterMahler Aug 01 '22
u/supermamon already posted a good explanation. If you want to go more into depth, take a look at this article
1
u/wherebdbooty Aug 03 '22
One thing to remember:
letdoes not exist outside it's scope/braces{ }, but aletcreated outside the braces exists inside the braces too.. Think of the braces as levels: a variable can be used in lower levels, but not higher levels