var a;
const f1 = function(data) {
a = 1
f2 ()
}
const f2 = function() {
console.log(a)
return a
}
$("#submit").click(function(){
jQuery.post("/shop/add/",{"product_id":"380","quantity":a1}).done(function(){
jQuery.post("/shop/add/",{"product_id":"381","quantity":a2}).done(function(){
jQuery.post("/shop/add/",{"product_id":"382","quantity":a3})})});
});
fetch('https://api.github.com/gists/public')
.then((res)=>{
console.log('200');
return res.json()
})
.then((body)=>{
//let k = Object.keys(body[5].files)[0];
for(k in body[5].files){
console.log("filename: "+body[5].files[k].filename);
console.log("language: "+body[5].files[k].language);
console.log("raw_url: "+body[5].files[k].raw_url);
}
});
const regex = /(\w+)=(\d+)/gm;
const str = `test=2
set=4`;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}