javascript - How to give back only single values of a list and add it to a specific html element? -


i have script programmer giving list html. how can give single values , add them html?

$scope.getresult = function() {       $scope.result = [];        papfields.foreach( function( field ) {         var name = field[ field.length - 1 ];         $scope.result.push( [ field[ 0 ], name, +window[ name ] ] );       } );     }; 

please use for() instead of foreach

$scope.getresult = function() {     $scope.result = [];     for(var = 0; < papfields.length; i++){         var name = papfields[i][ field.length - 1 ];         $scope.result.push( [ papfields[i][ 0 ], name, +window[ name ] ] );     } }; 

Comments