iwtn,
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
var obj = {
student: "Vasya",
age: 19,
some_prop: [1, 2, 3],
some_prop2: {}
};
var obj2 = {
};
function fromObjToObj2(objFrom, objTo){
for(var i = 2;i<arguments.length;i++){
for(var key in objFrom){
if(key == arguments[i]){
objTo[key] = objFrom[key]
}
}
}
}
fromObjToObj2(obj, obj2,'age','student');
alert(JSON.stringify(obj2))
</script>
</body>
</html>