implementing set in javascript