Function toLocaleString() and toString()
For functions, the methods toLocaleString() and toString() always return the function's code.
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var f = function sayColor(){
document.writeln("asdf");
}
document.writeln(f.toLocaleString());
</script>
</head>
<body>
</body>
</html>
Home
JavaScript Book
Essential Types
JavaScript Book
Essential Types
Function:
- The Function Type
- Function Declarations versus Function Expressions
- Functions as Values
- Returning a function from a function
- Function arguments
- this for function context
- Function caller
- Function length property
- Function apply()
- Function.call() method
- Function's bind() method
- Function toLocaleString() and toString()