JS Map Method

 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var ary = [11,4,9,16];

	var b = ary.map(test);
	document.write(b);

	function test(x){
		return x * 10;
	}
  </script>
</head>
<body>
</body>
</html>
 
<!DOCTYPE html>
<html>
<head>
  <title>JavaScript</title>
  <script>
    var ary = [
      {fname : "Yahoo" , lname : "Baba"},
      {fname : "Rahul" , lname : "Kumar"},
      {fname : "Karan" , lname : "Sharma"},
    ];

    var b = ary.map(test);
    document.write(b);

    function test(x){
      return x.fname + " " + x.lname;
    }
  </script>
</head>
<body>
</body>
</html>