just sharing this enjoyable picture image with a text post
javascript Reply Hide Lydia Gudgedale - Sat, 12 May 2018 20:10:25 EST r5si74OP No.37533 File: 1526170225292.png -(863168B / 842.94KB, 1452x2208) Thumbnail displayed, click image for full size. just sharing this enjoyable picture image with a text post >> Rebecca Blebblelock - Sat, 12 May 2018 23:20:04 EST lP7MCiRB No.37536 Reply 1526181604017.gif -(34345B / 33.54KB, 600x450) Thumbnail displayed, click image for full size. >>37533Yes >> Isabella Gimmerhall - Sun, 13 May 2018 06:14:36 EST Xm/W+3lL No.37537 Reply I liked that. Thanks for sharing, OP. >> Doris Cradgelot - Fri, 18 May 2018 03:26:20 EST +joVuqaF No.37543 Reply 1526628380219.jpg -(46819B / 45.72KB, 330x512) Thumbnail displayed, click image for full size. That behavior's not actually a bug. Loose equals (`==`) just means that type coercion is allowed. Section 11.9.3 of the ES5 specification says if both things being compared have the same type, they're compared via identity; if they have different types, perform the following steps are until both things have the same type (then they're compared via identity).for x == y:2) If x is null and y is undefined, return true.3) If x is undefined and y is null, return true.4) If Type(x) is Number and Type(y) is String, return the result of the comparison x == ToNumber(y).5) If Type(x) is String and Type(y) is Number, return the result of the comparison ToNumber(x) == y.6) If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y.7) If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).8) If Type(x) is either String or Number and Type(y) is Object, return the result of the comparison x == ToPrimitive(y).9) If Type(x) is Object and Type(y) is either String or Number, return the result of the comparison ToPrimitive(x) == y.So according to rule 4: 0 == "0" reduces to 0 == Number("0") which reduces to 0 == 0 which is true.And according to rule 8: 0 == [] becomes 0 == [].valueOf(). Since [].valueOf() doesn't return a primitive (it returns an array, which is an object), the expression becomes 0 == [].toString() or 0 == "". Rule 4 is invoked: 0 == Number("") resolves to 0 == 0, which is true."0" == [] does not work because the rules for loose equals coerce it into "0" == "" which is unquestionably false.If you don't like type coercion, stop comparing things of different types, or use strict equals, which does not coerce types at all. >> Shit Fanfield - Fri, 01 Jun 2018 20:05:49 EST +t8dQYkO No.37550 Reply Eso marea >> Hannah Ballyspear - Sat, 02 Jun 2018 10:04:55 EST 9QSfnS0r No.37554 Reply >>37543Worse of all[] == {}false >> Hannah Ballyspear - Sat, 02 Jun 2018 10:09:46 EST 9QSfnS0r No.37555 Reply >>37554That said I don't use the equality operator in most cases.Where type coercion is useful are (sadly neeccesary santiy checks like)if (thing && otherthing && thing[otherthing] && thing[otherthing].value ) { // use thing[otherthing].value} >> Angus Clommermud - Tue, 26 Jun 2018 16:05:30 EST lP7MCiRB No.37570 Reply Just sharing this enjoyable link of a Markov chain trained on the Puppet documentation and the assorted works of H. P. Lovecraft.Excerpt:“At length they emerged on a muddy road to find the server, how to authenticate to it, and more.”http://thedoomthatcametopuppet.tumblr.com/? >> Fanny Gunnerstock - Sat, 30 Jun 2018 07:54:12 EST lP7MCiRB No.37571 Reply 1530359652515.png -(729B / 729bytes, 135x34) Thumbnail displayed, click image for full size. > Haskell
>> Rebecca Blebblelock - Sat, 12 May 2018 23:20:04 EST lP7MCiRB No.37536 Reply 1526181604017.gif -(34345B / 33.54KB, 600x450) Thumbnail displayed, click image for full size. >>37533Yes
>> Isabella Gimmerhall - Sun, 13 May 2018 06:14:36 EST Xm/W+3lL No.37537 Reply I liked that. Thanks for sharing, OP.
>> Doris Cradgelot - Fri, 18 May 2018 03:26:20 EST +joVuqaF No.37543 Reply 1526628380219.jpg -(46819B / 45.72KB, 330x512) Thumbnail displayed, click image for full size. That behavior's not actually a bug. Loose equals (`==`) just means that type coercion is allowed. Section 11.9.3 of the ES5 specification says if both things being compared have the same type, they're compared via identity; if they have different types, perform the following steps are until both things have the same type (then they're compared via identity).for x == y:2) If x is null and y is undefined, return true.3) If x is undefined and y is null, return true.4) If Type(x) is Number and Type(y) is String, return the result of the comparison x == ToNumber(y).5) If Type(x) is String and Type(y) is Number, return the result of the comparison ToNumber(x) == y.6) If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y.7) If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).8) If Type(x) is either String or Number and Type(y) is Object, return the result of the comparison x == ToPrimitive(y).9) If Type(x) is Object and Type(y) is either String or Number, return the result of the comparison ToPrimitive(x) == y.So according to rule 4: 0 == "0" reduces to 0 == Number("0") which reduces to 0 == 0 which is true.And according to rule 8: 0 == [] becomes 0 == [].valueOf(). Since [].valueOf() doesn't return a primitive (it returns an array, which is an object), the expression becomes 0 == [].toString() or 0 == "". Rule 4 is invoked: 0 == Number("") resolves to 0 == 0, which is true."0" == [] does not work because the rules for loose equals coerce it into "0" == "" which is unquestionably false.If you don't like type coercion, stop comparing things of different types, or use strict equals, which does not coerce types at all.
>> Hannah Ballyspear - Sat, 02 Jun 2018 10:04:55 EST 9QSfnS0r No.37554 Reply >>37543Worse of all[] == {}false
>> Hannah Ballyspear - Sat, 02 Jun 2018 10:09:46 EST 9QSfnS0r No.37555 Reply >>37554That said I don't use the equality operator in most cases.Where type coercion is useful are (sadly neeccesary santiy checks like)if (thing && otherthing && thing[otherthing] && thing[otherthing].value ) { // use thing[otherthing].value}
>> Angus Clommermud - Tue, 26 Jun 2018 16:05:30 EST lP7MCiRB No.37570 Reply Just sharing this enjoyable link of a Markov chain trained on the Puppet documentation and the assorted works of H. P. Lovecraft.Excerpt:“At length they emerged on a muddy road to find the server, how to authenticate to it, and more.”http://thedoomthatcametopuppet.tumblr.com/?
>> Fanny Gunnerstock - Sat, 30 Jun 2018 07:54:12 EST lP7MCiRB No.37571 Reply 1530359652515.png -(729B / 729bytes, 135x34) Thumbnail displayed, click image for full size. > Haskell