let str = "product_id=40&quantity=1";
let id = (function(s){
let arr = s.split("&");
for(let i = 0; i < arr.length; i++){
let id = arr[i].split("=");
if(id[0] === "product_id"){
return id[1];
}
}
})(str);
alert(id);
var request = require('request');
var Sugar = require('sugar');
Sugar.extend();
var fs = require('fs');
request('http://google.com/doodle.png').pipe(
fs.createWriteStream('doodle.png')
);
var a = ['a','b','a'];
console.log(a.count('a'));