Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
var rows=[
  {
    id: 1,
    name: 'Glenn',
    dropped: false,
    dataType: '',
    type: 'input',
    path: ''
  },
  {
    id: 2,
    name: 'Andrew',
    dropped: true,
    dataType: '',
    type: 'input',
    path: ''
  },
  {
    id: 3,
    name: 'Birgit',
    dropped: false,
    dataType: '',
    type: 'input',
    path: ''
  }
];
var cellValues=[
  '/some/file/path/1',
  '/some/file/path/2',
  '/some/file/path/3',
];
/* Option 1 */
var rowsIndex=1;
rows[rowsIndex].paths=cellValues;
//Logging
console.log("Option 1");
console.log(rows[rowsIndex]);
/* Option 2*/
var rowsIndex=1;
for(var i=0;i<cellValues.length; i++) {
  rows[rowsIndex]["path"+i]=cellValues[i];
}
//Logging
console.log("=============================");
console.log("Option 2");
delete rows[rowsIndex].paths; //remove paths prop for demo
console.log(rows[rowsIndex]);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers