You need to position the point exactly after the closing parenthesis. Then it should work.
UPD The / messes up the syntax
I've checked again and the fault is the js-mode redefining the syntax table for its regex literal.
Here's the fix:
(defun eval-last-sexp-js (eval-last-sexp-arg-internal)
(interactive "P")
(save-excursion
(while (re-search-backward "(/" (line-beginning-position) t)
(remove-text-properties
(match-beginning 0)
(1+ (match-end 0))
'(syntax-table))))
(eval-last-sexp eval-last-sexp-arg-internal))
eval-last-sexp-js
will work the same as eval-last-sexp
.
You can rebind it specifically for js-mode
if you want.