0

the Strict equal operator only appeared in Javascript1.3 and ECMAscript 3rd edition.

the oldest browser i have is IE6, which implements 1.3. So I don't have any practical way to test the outcome of === on those browsers.

if I use === what will happen to javascript1.2 browsers?

and do they still exist today to the point I should care?

Edit 1: people are suggesting i should just test with <script language="JavaScript1.2">. Well, it does not work like that.

I executed this on modern Firefox and Chrome:

<script language="JavaScript1.2">
    alert( "1" === 1 );
</script>

and it simply returned False. which is absolutely not what would happend on javascript1.2 (it will be either syntax error or True).

gcb
  • 13,901
  • 7
  • 67
  • 92
  • I don't think you should care, but my guess is, they would throw a syntax error. – bfavaretto Apr 09 '13 at 01:54
  • Ummm I really do not think you should care unless you know of people still using windows 98.... – Naftali Apr 09 '13 at 01:55
  • I would suggest not caring about any browser *that* old, unless you actually know of a specific instance you need to support. – Mike Christensen Apr 09 '13 at 01:55
  • possible duplicate of [Testing compatibility for javascript 1.2](http://stackoverflow.com/questions/6308692/testing-compatibility-for-javascript-1-2) – tckmn Apr 09 '13 at 01:56
  • @Doorknob I actually tried that solution, and for `===` it simply worked as if it were 1.3 (tested on latest Firefox and chrome). Please, remove the duplicate notice, i've edited to cover that. Thank you. – gcb Apr 09 '13 at 02:02
  • 1
    `language` is deprecated, and the values were never standardized, so no surprise here that modern browsers just ignore it. See: https://developer.mozilla.org/en-US/docs/HTML/Element/script Plus, the current engines are so different from the ones of 15 years ago, that I don't think they kept that legacy code. – ZER0 Apr 09 '13 at 02:14

1 Answers1

2

You really, really shouldn't care about them. We're talking about the early version of Netscape 4, that was released on 1997 and no one it's using anymore. And honestly, if you will have to write code that is compatible with such browsers, you have bigger issues than the strict equal operator.

So, unless you have a real use case – and I really hope for you that you haven't – I wouldn't care. I will likely threat such browsers as "No JavaScript Enabled" browser, display them a pure text version of the website or a warning message to upgrade their browser.

ZER0
  • 24,846
  • 5
  • 51
  • 54