0
function s(e) {
    return e.toString();
}

var a = s(3); // works

var b = 3.toString(); // error

For example, set var a to the return value of s() that returns the first argument.toString(), but you can't set var b to 3.toString()

sdfsdf
  • 5,052
  • 9
  • 42
  • 75
  • 3
    Duplicate of [Why can't I access a property of an integer with a single dot?](http://stackoverflow.com/q/9380077/218196) – Felix Kling Jun 05 '16 at 02:10

1 Answers1

1

Javascript is expecting number(s) after the decimal, you can still do this, but you need to put your number in parenthesis:

(3).toString() = "3"
omarjmh
  • 13,632
  • 6
  • 34
  • 42