override(target, source);
target. Element to overwrite.
source. Element that overwrites the other element.
The override method overwrites one element with another.
To execute the example, add a link to PP.js scenario file to HTML page. Create two arrays of integers and overwrite the first array with the second:
// Determine integer arrays var num1 = [5, 1, 9, 6]; console.log("Source array of elements: [" + num1 + "]"); var num2 = [2, 9, 6, 7, 5]; // Override the first array with the second one PP.override(num1, num2); console.log("Overridden array of elements: [" + num1 + "]");
After the example two arrays are created, the second array overwrites the first one:
Initial array of elements: [5,1,9,6]
Overwritten array of elements: [2,9,6,7,5]
See also: