Jump to content

Safe to use 'let' in MIDI scripts?


onerob

Recommended Posts

I'm wondering if it's OK to use let instead of var in some cases in a script, specifically with relation to backwards compatibility.

 

Safari didn't support let until 2017 and I'm wondering if that has any bearing on Logic, e.g. if Logic uses the js engine from Webkit and therefore changes over the years. This would mean that let was not available when MIDI scripting first appeared in Logic and so any scripts making use of it wouldn't be backwards compatible with older releases.

 

Or does Logic have its own internal js engine?

Link to comment
Share on other sites

Scripter is using safari’s JavaScript. “Let” doesn’t work in older versions of OS X but I can’t remember te the cutoff version.

 

There is very little benefit in using “let” or “const” instead of “var” in scripter scripts which are typically quite small and simple. If in doubt just use “var”. That being said I use “let” and “const” all the time now out of habit

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...