Split function overrides string.split?

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);

Oh, I fixed the problem, my path should have been fileObj.path instead of lib.path

but this is still a problem with p5 and it thinking that I was using the split function.