working on order of operations in javascript