onerob Posted April 21, 2021 Share Posted April 21, 2021 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? Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted April 21, 2021 Share Posted April 21, 2021 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 Quote Link to comment Share on other sites More sharing options...
onerob Posted April 21, 2021 Author Share Posted April 21, 2021 Thanks. I'll avoid 'let' in the script I'm currently working on, as I may be posting it online at some point. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.