function Clonename(clonOne, numbClone) {
var clone = {};
var arr = new Array()
if(numbClone === 1 || numbClone === undefined) {
for(key in clonOne) {
clone[key] = clonOne[key]
}
clone.name = 'Bob'
} else {
for(index in clonOne) {
arr.push(clonOne[index])
}
console.log(arr)
}
}
Clonename(user,2)
function ololo(obj, count = 1) {
let values = Object.values(obj)
if (count === 1)
return values
else
return new Array(count).fill(values)
}
https://jsfiddle.net/hbeb6h02/