else if (extension === 'css') { better

if the extension is 'js' is not needed to check if it is 'css'