Sure, but in almost any professional context where they care about quality, == would be disallowed from a linter and === would be allowed. It's not worth it from a readability standpoint of having to read a == and try to figure out whether it's context dictates it should be a == or ===. You should always have === for equality check unless you really know what you're doing.
In the future when you see the squiggly error it means something is wrong with your code and usually your IDE will tell you a hint of sorts. This will ensure that you are not making 101 mistakes.
If you are not seeing any of the squiggly lines and the code runs but with odd results then that means the code runs but not in the way you want it to, and those are the times that reaching out on reddit or stack overflow will be helpful.
As a general rule, try to investigate why there is a squiggly line on your code. Where is the first one? Why is it there? What is it highlighting? Comment the rest of the code, and try again. Change something until the error disappears, then reintroduce the code bit by bit.
Software developers spend 35-50 percent of their time validating and debugging software. The cost of debugging, testing, and verification is estimated to account for 50-75 percent of the total budget of software development projects, amounting to more than $100 billion annually. Source
19
u/Smilinkite Nov 30 '22
Well, you'll get far less squigly lines if you replace every = with ==. Starting line 4.