JS object method helper