Loading ...
Sorry, an error occurred while loading the content.

Type Conversion with +"5"

Expand Messages
  • Luke Page
    JSLint now complains about a = a + which is great. Should it also complain about un-necessary + operator (e.g. it can only be used for type conversion).
    Message 1 of 1 , Feb 17, 2011
    • 0 Attachment
      JSLint now complains about
      a = a + ""

      which is great.

      Should it also complain about un-necessary + operator (e.g. it can only be
      used for type conversion). e.g.

      var a = "5";
      var b = +a; // should be Number(a)
      var c = +"12"; // not sure why you'd ever want to do this


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.