JavaScript String toString() MethodThe JavaScript toString() method returns a string representing the calling object. In other words, this method provides a string representation of the object and treats same as the valueof() method. SyntaxThe toString() method is represented by the following syntax: ReturnsA String representing the object JavaScript String toString() Method ExampleLet's see some simple examples of toString() method. Example 1Here, we will print the value of string object. Test it NowOutput: Javatpoint Example 2Let's see one more example to print the value of string object. Test it NowOutput: Javatpoint
Next TopicJavaScript String
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week