I know this has been put out too many times, but none of the questions fix the problem I have. It gives me the following error every time I run the function:
TypeError: Cannot read property 'toLowerCase' of undefined
Here's the code it's running:
global.toId = function(text) {
return text.toLowerCase().replace(/[^a-z0-9]/g, '');
};