I know the difference between the two of 'em. But because Javascript is not a strict language and because other plugins may make mistakes (like putting '2' in the Actor.actorId instead of 2), using === may not always be a good idea unless it's purely for comparing your own variables?
I usually try to use as much === as possible, but only for my own variables. Is that good or bad? 😛 .
Strings are a special case:
Of course for comparing objects. However, using === for strings can be dangerous if a string was created with String:
alert(new String('foo') === 'foo'); // falsealert(new String('foo') == 'foo'); // trueBecause you never know if the other person in some other plugin for some reason used a String() instead of a '' you can't use === for comparing strings that come from the RM-API either.
Strict equality is typically preferred because of its strictness of type. However, if you're running into issues of equality where you're comparing two completely different types, there's a chance that your coding needs improvement. Also, never use new String(). There's literally no point to doing so.
If other plugins store wrongly formatted values, that's entirely their fault.
Today I saw another scripter who does exactly that... Stores floats as strings. Also used "strict mode" in the global scope and of course an anonymous function so I can't extend his script w/o fully overwriting it. And on top of that cluttering the global with (unused!) global variables (so much for the anonymous function...) and much more...
When looking through other people's code (which is good practice if you want to use it for your project, you don't want plugins written by amateur-scripters because they will just raise bugs in other scripts), I often see the same 'mistakes'.
I could just blindly use the === operator on RM-API's. BUT, if I use other people's scripts (not written by pro's like Yanfly, Iavra or Viktor, etc.) I risk a lot of nasty bugs that can be really bothersome to track down. Until I probably decide to disable the other plugins and find out that some 'amateur scripter' used the wrong type and put it back into the RM-API..
Basically, the === operator when used on the RM-API can potentially be bothersome. But it can also potentially increase performance by a lot. Especially in big loops in the update-method. Therefor I thought it was a good idea to only use the === on your own variables, and use the == on the RM-API.
You can obviously adapt to the ineptness of other people's codes, or opt not to use them and roll your own.
Maybe you could just open any scripts your using, and type "new string" in the search function, and then replace the command?
It sounds tedious, but it's a possibility.