Question: Is there a way to clone an object with only few properties of the object in JS?
For example.. 

```
var Person = {
    name: "Bob",
    age: 32,
    salary: 20000
};

```

I have to create another person object with just the name and age property so that it will look something like this : 

```
var clonedPerson = {
    name: "Bob",
    age: 32
};

```

I could do a deep clone of the object and *delete*. But I wanted to know if there are better ways to do it.

Answer: 
More simple?

```js
var Person = {
    name: "Bob",
    age: 32,
    salary: 20000
};
var ClonedPerson = jQuery.extend({}, Person);
delete ClonedPerson.salary;

console.log(JSON.stringify(Person));
console.log(JSON.stringify(ClonedPerson));
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
```
an alternative approach using Array member methods:

```
var clone = Object.keys(Person) // convert to an Array of Person keys
            .filter(function(key){return ["salary"].indexOf(key) == -1;}) // exclude key salary
            .reduce(function(clone, current){clone[current] = Person[current]; return clone;}, {}); // convert back the array to a cloned literal object

```