Skip to main content

JS QA:3

Let's begin


JavaScript Question Answers:

Q1: How to create a copy of array and create a new reference for new object?
We can simply make it's length =0 as a result the array reference and array would be removed.
we can initialize array again to empty array but still reference would be left so we need to make it's length =0

See result on jsfiddle

Comments

Popular posts from this blog

JS QA:1

Let's begin JavaScript Question Answers: Q1: Create a function which will give the result as expected: Function  f(2)(2)(1);  Output  5 See result on  jsfiddle

JS QA:2

Let's begin JavaScript Question Answers: Q1: How to delete the array with it's reference? We can simply make it's length =0 as a result the array reference and array would be removed. we can initialize array again to empty array but still reference would be left so we need to make it's length =0 See result on  jsfiddle