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 array =["a.READ","b.CREATE"]
var arr1=[],arr2 = [];
array.forEach(function(item,index,arr){
  item.split('.').forEach(function(item,index,arr){
    if(index % 2 ===0){
      arr1.push(item);
    }else{
      arr2.push(item);
    }
  });
  
});
console.log(arr1);
console.log(arr2);
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers