What is array toString JavaScript

In this article, i will go to explain array toString() in JavaScript.
  • 1787

Array toString() in JavaScript

The JavaScript array toString method converts an array into a string.

Syntax of toString method


It has no parameter.

Return value of  toString  method

tostring method returns a string representing the array.

Example of toString method

<!DOCTYPE html>



<title>JavaScript Array toString Method</title>



<script type="text/javascript">

var val = new Array("one", "two", "three","four");

var retstr = val.toString();

document.write("Returned string is : " + retstr );





Ask Your Question 
Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.