ES6 validate JS sample