simple compare vs object cast

Edit on GitHub

Setup

var a = 'asd'
var b = 'asd'

Tests

  • simple compare

    a===b
  • object cast

    var oa = new String(a)
    oa.valueOf()===b