Ad Code

Specify Java aliasing problem in Java script array?


Specify the Java aliasing problem in Java script array? Give proper Example when and where needed

Array types (composite type as well) are reference types, so problem of aliasing is there

var firstArray = [“Mars”, “Jupiter”, “Saturn” ];

var secondArray = firstArray;

secondArray[0] = “Neptune”;

alert(firstArray); // it has been changed
Reactions

Post a Comment

0 Comments