Ask a Question    Search Answers  

Category
Computers >> Programming Concepts >> Java

Question
How to use "join()" to create a string from an array using JavaScript?  (1 answers) Posted by: nvreddy   Ask a Friend

Answers
1.

"join" concatenates the array elements with a specified seperator between them.

<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"];
document.write("days:"+days.join(","));
</script>
This produces
days:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday    Answered by: venkatreddy04


    Add an Answer to this Question
    Add a New Question
    Notify updates to this question
    Mail to a Friend
Rate this answer:       Exact       Correct       somewhat correct       wrong       spam

User comments


  What is the difference between HttpServlet and GenericServlet?
  What are the common mechanisms used for session tracking? ?
  Explain the life cycle methods of a Servlet. ?
  How does JSP handle run-time exceptions? ?
  How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
  Explain the life-cycle mehtods in JSP?
  What environment variables do I need to set on my machine in order to be able to run Java programs?
  Can a public class MyClass be defined in a source file named YourClass.java? ?
  What will be the default values of all the elements of an array defined as an instance variable?
  What is the difference between static and non-static variables?
  How does Java handle integer overflows and underflows?
  What is synchronization and why is it important?
  How do I dynamically disable/ enable form elements using JavaScript?
  How do I manipulate radio and check boxes in JavaScript?
Add New Question
Glossary
Add Glossary
 
Copyright © 2009-10 Krify Software Technologies Pvt Ltd. All rights reserved.