We help IT Professionals succeed at work.

Javascript function passing an array to another function.

BILL Carlisle
on
Medium Priority
2,125 Views
Last Modified: 2010-04-21
How do I pass an array from one function to another, or can you.??

<script type="text/javascript">
  var startdates   = new Array();
  var starttimes   = new Array();
  var enddates     = new Array();
  var endtimes     = new Array();
 
function timeOverlap(colHeader){
    //load arrays
  blah..
  blah..
 
}
 function checkOverlap(starttimes,endtimes){
      alert('in checkOverlap'+starttimes.length); 
      return false;
  }
 }
</script>

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Commented:
you can pass an array have a look at the example in the link
http://www.java2s.com/Code/JavaScript/Language-Basics/ArrayUtilityfunctions.htm
BILL CarlisleAPEX Developer

Author

Commented:
This was great! The link took me straight to the array example I needed.
Thank you!