---
title: "Discussion on \"Tricky JavaScript Interview Problem\" | Hashnode"
description: "Discussion on \"Tricky JavaScript Interview Problem\". Do you know the answer to this tricky javascript interview problem about objects and their properties?\nEven if you correctly guess the answer, do watch till the end because I also talk about a new and cool ES6 feature related to the same problem.\nIf ..."
url: "https://hashnode.com/posts/tricky-javascript-interview-problem/5dfa9dabacdafdac270db678"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Tricky JavaScript Interview Problem](https://hashnode.com/post/tricky-javascript-interview-problem?utm_source=hashnode&utm_medium=feed)

Do you know the answer to this tricky javascript interview problem about objects and their properties? Even if you correctly guess the answer, do watch till the end because I also talk about a new and cool ES6 feature related to the same problem. If ...

Dec 18, 2019 · hashnode.com  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#interview](https://hashnode.com/tag/interview)
-   [#career](https://hashnode.com/tag/career)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Satyam Yadav](https://hashnode.com/@satyam1729)

@satyam1729

  
[View profile](https://hashnode.com/@satyam1729)

Software Engineer at Microsoft

## Responses 1

Markdown supported · ⌘↵ to post

[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]
```
