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>
  <pre id=a></pre>  
</body>
</html>
 
var s = "x:100%,y:20%,radius:50%";
var json = JSON.stringify(
    s.split(',').reduce(function(m,v) {
       var t = v.split(':');
       m[t[0]] = t[1];
       return m;
    }, {})
 );
console.log(json);
document.getElementById('a').innerHTML = json;
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers