I know this is only a few lines of code, but as far as I can tell this is independent from the rest of the project. However anyone thinks more context would be helpful I can post more code. And now for the strangest issue I have ever seen in all my years as a Javascript developer.
Please Help
Is there any reason that these two statements would be different?
require('./themes/'+'purple'+'.json');
require('./themes/'+['purple'][0]+'.json');
The first statement works, but the second does this:
I also tried this:
require('./themes/'+['purple'].pop()+'.json');
And to debug I tried this:
'./themes/'+'purple'+'.json' === './themes/'+['purple'][0]+'.json' // returns true
I don't understand how this is possible. I need to be able to select a theme from an array of themes.