In the address bar, type about:config and press enter.
Click I'll be careful, I promise! on the next dialogue that comes up.
Find the preference named javascript.enabled. To easily find the option, type the word "javascript" in the search bar.
Right-click on javascript.enabled and select Toggle.
Close the tab to save the settings. If you have any other tabs open, click on the Reload button so that the changes can take affect.