optimize javascript property