---
title: "Comment by Biplab Malakar on \"Tricky JavaScript Interview Problem\" | Hashnode"
description: "Question: 1 a = [ 1 , 2 , 3 , 4 ]; a[ 'abc' ]= \"5\" ; a.length = 0 ; console .log(a[ 2 ]); // ? console .log(a.abc); // ? Question: 2 a = {a: 1 , b: 2 , c: null"
url: "https://hashnode.com/posts/tricky-javascript-interview-problem/5dfa9dabacdafdac270db678/comment/5dfcb5a0acdafdac270dc45f"
---

[Discussion](https://hashnode.com/posts/tricky-javascript-interview-problem/5dfa9dabacdafdac270db678)

Comment [Tricky JavaScript Interview Problem](https://hashnode.com/posts/tricky-javascript-interview-problem/5dfa9dabacdafdac270db678)

[Biplab Malakar](https://hashnode.com/@BIPLAB)

[Dec 20, 2019](https://hashnode.com/posts/tricky-javascript-interview-problem/5dfa9dabacdafdac270db678/comment/5dfcb5a0acdafdac270dc45f)

Question: 1

```
a = [1,2,3,4];
a['abc']="5";
a.length =0;
console.log(a[2]);// ?
console.log(a.abc);// ?
```

Question: 2

```
a = {a: 1, b: 2, c: null, d: undefined};
b = JSON.parse(JSON.stringify(a));
console.log(b);//?
```

Question: 3

```
//Write code such that, if I write
a = [...10]
//Now if I print a, then output should be
console.log(a);//[1,2,3,4,5,6,7,8,9,10]
```
