javascript toSource() method
Translation results:
英[sɔ:s] 美[sɔ:rs]
n.root, origin; source, source of water; reason; person who provides information
vt. (obtained from...) ; initiate; provide information to...; seek the source (especially supply)
vi. Source of raw materials; origin; seek source; seek manufacturer (or provider)
Third person singular : sources plural: sources present participle: sourcing past tense: sourced past participle: sourced
javascript toSource() methodsyntax
How to use the toSource() method?
The toSource() method returns a string representing the source code of the object. When debugging, you can use the toSource method to view the contents of an array.
Function: represents the source code of the object. This primitive value is inherited by all objects derived from the Array object. The toSource() method is usually called automatically by JavaScript in the background and does not appear explicitly in the code.
Syntax: object.toSource()
Comments: Only Gecko core browsers (such as Firefox) support this method, that is to say Browsers such as IE, Safari, Chrome, and Opera do not support this method.
javascript toSource() methodexample
<html> <body> <script type="text/javascript"> function employee(name,job,born) { this.name=name; this.job=job; this.born=born; } var bill=new employee("Bill Gates","Engineer",1985); document.write(bill.toSource()); </script> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance