Javascript functions available in MaxMSP

neurofrantic's icon

Can anyone point me to a simple list of the standard Javascript functions/methods that are available in MaxMSP (currently using Max8)? This should be totally upfront in the documentation, buy I've spent the last hour perusing the Max docs with no success.

I wanted to use the Javascript includes() function to test for the presence of a substring, but Max8 says there is no such function.

I'm pretty experienced in (real) Javascript in other settings, and it's pretty frustrating to type up some valid JS code and then have Max tell you it is incorrect.

A simple list of supported functions would be a great time saver, and it's hard to understand why no such list is provided, or, if it is, it's so difficult to locate.

(PS: YES, I did finally end up using indexof() to solve my issue, but after a good bit of avoidable frustration).

Joshua Kit Clayton's icon

string.includes() is not available in ECMA Script 5 (ES5).

In Max 8, you are limited to ES 5 in the JS object, or ES 2022+ in the node.script object or jweb out of process:

In Max 9 you can use up to ES2022 in the v8 object in process.

neurofrantic's icon

Hi Joshua,

Thanks for your prompt response which clears up the issue for me. I only wish I could have saved you the trouble by finding the information in the documentation.

Joshua Kit Clayton's icon

In Max 9 we've updated the help files and reference to make this clear.