What is tostring in javascript?
array tostring method javascript:
toString() method means converting an array into a string with a comma-separated.
Syntax of
toString method:
array.toString()
join method but in the join method, we can create separation as we
want.
tostring example in javascript:
const colors = ["Red", "blue", "Black", "Orange", "White", "Coffee"];
console.log(colors.toString());
// "Red,blue,Black,Orange,White,Coffee"
console.log(colors.toString(" * "));
// I have used star in parenthesis but result will be same as
above: "Red,blue,Black,Orange,White,Coffee"
No comments:
Note: Only a member of this blog may post a comment.