updated for Nicholas C. Zakas's Understanding ECMAScript 6