Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

When to use strict mode?

12:57 am on Oct 15, 2012 (gmt 0)

Full Member

5+ Year Member Top Contributors Of The Month

joined:Sept 30, 2009
votes: 1

I know the benefits of using strict mode to test out the script, but should it only be used for testing?

It seems to benefit is finding errors. If there are some errors that slip by during testing, I would rather they silently fail and not take down the whole page.

Should I remove strict mode before putting the code live or do most people keep it in their code?
2:19 am on Oct 16, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
votes: 0

A lot of what strict mode enforces is syntax and would be picked up in testing. No idea what most people do, probably never use strict mode at all.

I would leave it in, 'silently fail' means you have no idea what is happening, depending on nature of site that could be a bigger danger to you business.