For some reason every time, when I tried to use the string.split()
function, but it says this error.
TypeError: Cannot read properties of undefined (reading 'split')
Did you just try to use p5.js's split() function? If so, you may want to move it into your sketch's setup() function.
For more details, see: https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup
My code specifically uses this:
const filesToLoad = [ { path: 'Bruh.png', forLib: ['p5'] } ]
...
const ext = lib.path
.split('.')
.slice(-1);