Writes one array into another, and saves the old content - Node.js Array

Node.js examples for Array:Array Value

Description

Writes one array into another, and saves the old content

Demo Code

function exchangeArrays(aFrom, aTo, offs)
{
  var u, len = aFrom.length;
  for(var i=0; i < len; i++, offs++){
    u = aTo[offs];//  www . j a  v a  2 s. c o  m
    aTo[offs] = aFrom[i];
    aFrom[i] = u;
  }
}

Related Tutorials