virtual-labs-archive / artificial-neural-networks-iiith

This repository contains the source for Artificial Neural Networks Lab IIITH
http://cse22-iiith.vlabs.ac.in
Other
5 stars 239 forks source link

Expected '===' and instead saw '=='. (eqeqeq) #44

Open BSravanthi opened 5 years ago

BSravanthi commented 5 years ago

It is considered good practice to use the type-safe equality operators === and !== instead of their regular counterparts == and !=. The reason for this is that == and != do type coercion which follows the rather obscure Abstract Equality Comparison Algorithm. For instance, the following statements are all considered true: [] == false [] == ![] 3 == "03" If one of those occurs in an innocent-looking statement such as a == b the actual problem is very difficult to spot. You can choose the equlityStyle you prefer, either "smart" or "allow-null"

"smart" This option enforces the use of === and !== except for these cases:

Comparing two literal values Evaluating the value of typeof Comparing against null

"allow-null" This option will enforce === and !== in your code with one exception - it permits comparing to null to check for null or undefined in a single expression.

//Smart: //Good: typeof foo === 'undefined' 'hello' !== 'world' 0 === 0 true === true foo === null //Bad: a == b foo == true bananas != 1 value == undefined Please refer to the following link to fix similar issues. https://app.codacy.com/app/BSravanthi/artificial-neural-networks-iiith/issues?&filters=W3siaWQiOiJMYW5ndWFnZSIsInZhbHVlcyI6W251bGxdfSx7ImlkIjoiQ2F0ZWdvcnkiLCJ2YWx1ZXMiOlsiRXJyb3IgUHJvbmUiXX0seyJpZCI6IkxldmVsIiwidmFsdWVzIjpbbnVsbF19LHsiaWQiOiJQYXR0ZXJuIiwidmFsdWVzIjpbMTY2MV19LHsidmFsdWVzIjpbXX1d

DevikaBoddu commented 5 years ago

Commit id's: f22e640-(1) a4ef14c-(2) 5819e5f-(3) c3d49f8-(4) 5b798a4-(5) 679f84c-(6) c7cb280-(7) 4154711-(8) 746ea6f-(9) faca671-(10) d533e33-(11) a1b63ef-(12) 66acb35-(13) cc23526-(14) 5ffa392-(15) 40eccb3-(16) 3076b77-(17) 255f024-(18) f69b59e-(19) 5e6449e-(20) 9c9169a-(21) ca8a50f-(22) 36a8ec0-(23) 1bf32b4-(24) 7d65c3c-(25) 65d3a60-(26) d9b552b-(27)

SadhuSantosh commented 5 years ago

valid fix: @DevikaBoddu

Khwaja-Bilkhis commented 5 years ago

validated-2 fix : @DevikaBoddu