rephrasing javascript decision according to @mekanics review finding