From 5d5924569928b252c1f0047fb8273659142693cd Mon Sep 17 00:00:00 2001 From: adhiartaputra Date: Fri, 23 Feb 2018 09:38:30 +0700 Subject: [PATCH 1/4] OOP Done --- oop/robot.js | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 oop/robot.js diff --git a/oop/robot.js b/oop/robot.js new file mode 100644 index 0000000..79b5da9 --- /dev/null +++ b/oop/robot.js @@ -0,0 +1,98 @@ +'use strict' + +class Robot { + constructor(name){ + this.name = name + } +} + +class Wall_E extends Robot { + constructor(name) { + super(name) + this.name = name || 'wall-E' + this.purpose = 'Worker' + } + + work() { + console.log(`${this.name} cleans planet`) + } +} + +class Baymax extends Robot { + constructor(name) { + super(name) + this.name = name || 'Baymax' + this.purpose = 'Medic' + } + + heal() { + console.log(`Hi, I am ${this.name}, how may I help you?`) + } +} + +class AutoBot extends Robot { + constructor(name) { + super(name) + this.name = name || 'AutoBot' + this.purpose = 'Defender' + } + + defend() { + console.log(`${this.name} let's roll!!`) + } +} +// +// let wall_E = new Wall_E() +// let bayMax = new Baymax() +// let autoBot = new AutoBot() + +class RobotFactory { + constructor(name,total) { + this.name = name + this.total = total + } + + static produceRobot(name,total) { + if(name === 'wall-e') { + let arrOfRobot = [] + for(let i = 0; i < total; i++) { + let robot = new Wall_E(name) + arrOfRobot.push(robot) + } + return arrOfRobot + } else if(name === 'baymax') { + let arrOfRobot = [] + for(let i = 0; i < total; i++) { + let robot = new Baymax(name) + arrOfRobot.push(robot) + } + return arrOfRobot + } else if(name === 'autobot') { + let arrOfRobot = [] + for(let i = 0; i < total; i++) { + let robot = new AutoBot(name) + arrOfRobot.push(robot) + } + return arrOfRobot + } + } +} +let wall_e = RobotFactory.produceRobot('wall-e', 6); +let baymax = RobotFactory.produceRobot('baymax', 5); +let autobot = RobotFactory.produceRobot('autobot', 3); +// +// console.log(wall_e); +// console.log(baymax); +// console.log(autobot); + +for (var i = 0; i < wall_e.length; i++) { + wall_e[i].work() +} + +for (var i = 0; i < baymax.length; i++) { + baymax[i].heal(); +} + +for (var i = 0; i < autobot.length; i++) { + autobot[i].defend(); +} From f4b3154a9f8f1300b54bd6f7f152a3327dc3b906 Mon Sep 17 00:00:00 2001 From: adhiartaputra Date: Fri, 23 Feb 2018 10:38:35 +0700 Subject: [PATCH 2/4] async done --- async/index.js | 93 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/async/index.js b/async/index.js index 77df3b7..20fd247 100644 --- a/async/index.js +++ b/async/index.js @@ -17,35 +17,96 @@ class RNG { return result; } + + static gatchaRoll(times,cb) { + let arr = [] + for(let i = 0; i < times; i++) { + arr.push(this.roll()) + } + arr.sort() + let result = 0 + arr.forEach(num => { + if(num === 0) { + result = num + } else { + result = num + } + }) + cb(result) + } + + static gatchaRollPromise(times) { + return new Promise ((res,rej) => { + if(times > 0) { + let arr = [] + for(let i = 0; i < times; i++) { + arr.push(this.roll()) + } + arr.sort() + arr.forEach(num => { + let result = 0 + if(num !== 0) { + result = num + res(result) + } + }) + } else { + rej(times) + } + }) + } } function viewGachaResult(best) { - console.log(`YOUR BEST GATCHA ROLL RESULT IS ${best}`); + setTimeout(function() { + // jalankan sesuatu disini setelah 1 detik + console.log(`YOUR BEST GATCHA ROLL RESULT IS ${best}`) + }, 1000); } function viewGachaFailure() { - console.log('YAKIN NGGAK MAU NGE-ROLL?'); + setTimeout(function() { + // jalankan sesuatu disini setelah 1 detik + console.log('YAKIN NGGAK MAU NGE-ROLL?') + }, 1000); } // RELEASE 0 TEST CASES -RNG.gatchaRoll(5, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik -RNG.gatchaRoll(1, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik -RNG.gatchaRoll(0, function(result) { viewGachaResult(result) }); // output: 0 +// RNG.gatchaRoll(5, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik +// RNG.gatchaRoll(1, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik +// RNG.gatchaRoll(0, function(result) { viewGachaResult(result) }); // output: 0 +// +// // RELEASE 1 TEST CASES +// RNG.gatchaRollPromise(5) +// .then(function(result) { viewGachaResult(result) }) +// .catch(function(err) { viewGachaFailure() }); +// +// // akan menampilkan di log: YOUR BEST GATCHA ROLL RESULT IS +// +// RNG.gatchaRollPromise(0) +// .then(function(result) { viewGachaResult(result) }) +// .catch(function(err) { viewGachaFailure() }); -// RELEASE 1 TEST CASES -RNG.gatchaRollPromise(5) - .then(function(result) { viewGachaResult(result) }) - .catch(function(err) { viewGachaFailure() }; +// akan menampilkan di log: YAKIN NGGAK MAU NGE-ROLL? -// akan menampilkan di log: YOUR BEST GATCHA ROLL RESULT IS -RNG.gatchaRollPromise(0) - .then(function(result) { viewGachaResult(result) }) - .catch(function(err) { viewGachaFailure() }; +// RELEASE 2 PROMISE(S) -// akan menampilkan di log: YAKIN NGGAK MAU NGE-ROLL? +// code here... +promise1 = RNG.gatchaRollPromise(5) +promise2 = RNG.gatchaRollPromise(1) +promise3 = RNG.gatchaRollPromise(2) +promise4 = RNG.gatchaRollPromise(3) +promise5 = RNG.gatchaRollPromise(4) +promise6 = RNG.gatchaRollPromise(2) +promise7 = RNG.gatchaRollPromise(2) +promise8 = RNG.gatchaRollPromise(3) +promise9 = RNG.gatchaRollPromise(2) +promise10 = RNG.gatchaRollPromise(3) -// RELEASE 2 PROMISE(S) +let arrOfPromise = [promise1,promise2,promise3,promise4,promise5,promise6,promise7,promise8,promise9,promise10] -// code here... \ No newline at end of file +Promise.all(arrOfPromise).then(promises => { + viewGachaResult(typeof promises) +}) From 069b60ebfe44d1d93e54b11c2e8c7b57f62ba4ed Mon Sep 17 00:00:00 2001 From: adhiartaputra Date: Fri, 23 Feb 2018 10:55:46 +0700 Subject: [PATCH 3/4] query done --- query/database.db | Bin 20480 -> 20480 bytes query/setup.js | 259 +++++++++++++++++++++++++--------------------- 2 files changed, 139 insertions(+), 120 deletions(-) diff --git a/query/database.db b/query/database.db index 77b32335557d0d8348af0a5f80acb8ba9da025e9..6fd03364753bbdf8759e7e61de8727a75ceb065e 100644 GIT binary patch delta 919 zcmXYvPfU|%9LJyE^LziaBG1#lv~;W*XsJkPQ7E_-+ENfi>?lQ4WQQ4F+YX9)+i6BGCSJ^*RWHxs`+R=C-{ zSAlaC_&Nyg)op{|zJB}%9`~_j!k_U?zQNadgQu7b4?~tcT`W0vUS>hVsB#m|jI(IH;p)9! zl?458$Sf|HCG&sm9m7+_a@LY#zr`B7yowDM&sb%!MCa;;D?-5HqTa1cxoi%hhcNcnX7K|t!Em4@-+F}6az45mZwio)c^)z ze9m05%BOv`gpes{5qigmQ?6OpfU8b_s^8RC^%;Gi9@PHPe%3B)^V)#6O?|1}RliY> zsc}_T9xFGL73CwP4PWC!ypCU?g$Y#XQ~C?NNKeszYQQG^2#YWdEvx5k+BzjJC!=sw z{F;owq_~paje7SH@gUtzyAF%do^CiK&iAy#gt*qT0}hHmQ=$BHRkd;b%pif|?3o_CuhBT6vP7&Ii5-XVq z^h&8+&?A*1kd#6p)Z*_;rFM8vO!jrb9%&SXZt2sAuGTJTv=jAE;!-vYozf_ZYG;RZ zO2BSu6hqvxOFFecyZAdBT^GqublKB+!e8(w{2sr>zvV0ZET871JjtUxz>)pS{$jtg zHFlLbX`}%uOgPTRMGLe?wJdwqDcfXYWae_1>+e8^>Mz)O!OZX+Y_-z^Z-|^q&KgqwDe*u3Fe`@Xs{|CdIGLEm8J!c0Qi^rB8JVRS19B28Q;UkZco`TNbT}qYW;cl3*l5hbq@goe t!%%bcJ_|Q?pt%+d{2%%6^PlG5%0G|4o4 { - if(!data){ - console.log("TABLE Players TELAH DIBUAT"); - }else{ - console.log(data); - } - }) - db.run(`CREATE TABLE IF NOT EXISTS Cards ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - name VARCHAR(50), - rank VARCHAR(50), - type VARCHAR(50), - skill VARCHAR(50), - playerId INTEGER, - FOREIGN KEY(playerId) REFERENCES players(id) - )`,data => { - if(!data){ - console.log("TABLE Cards TELAH DIBUAT"); - }else{ - console.log(data); - } - }) - db.run(`CREATE TABLE IF NOT EXISTS Status ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - title VARCHAR(100), - point INTEGER, - level INTEGER, - playerId INTEGER, - FOREIGN KEY(playerId) REFERENCES players(id) - )`,data => { - if(!data){ - console.log("TABLE Status TELAH DIBUAT"); - }else{ - console.log(data); - } - }) + // db.run(`CREATE TABLE IF NOT EXISTS Players ( + // id INTEGER PRIMARY KEY AUTOINCREMENT, + // name VARCHAR(50), + // gender VARCHAR(50), + // age INTEGER + // )`,data => { + // if(!data){ + // console.log("TABLE Players TELAH DIBUAT"); + // }else{ + // console.log(data); + // } + // }) + // db.run(`CREATE TABLE IF NOT EXISTS Cards ( + // id INTEGER PRIMARY KEY AUTOINCREMENT, + // name VARCHAR(50), + // rank VARCHAR(50), + // type VARCHAR(50), + // skill VARCHAR(50), + // playerId INTEGER, + // FOREIGN KEY(playerId) REFERENCES players(id) + // )`,data => { + // if(!data){ + // console.log("TABLE Cards TELAH DIBUAT"); + // }else{ + // console.log(data); + // } + // }) + // db.run(`CREATE TABLE IF NOT EXISTS Status ( + // id INTEGER PRIMARY KEY AUTOINCREMENT, + // title VARCHAR(100), + // point INTEGER, + // level INTEGER, + // playerId INTEGER, + // FOREIGN KEY(playerId) REFERENCES players(id) + // )`,data => { + // if(!data){ + // console.log("TABLE Status TELAH DIBUAT"); + // }else{ + // console.log(data); + // } + // }) + // + // db.run(`INSERT INTO Players + // VALUES + // (NULL, "Fayola", "Male", 20), + // (NULL, "Jerax", "Male", 24), + // (NULL, "Hamabe", "Female", 18), + // (NULL, "Matumbaman", "Male", 21), + // (NULL, "Fiverna", "Male", 31), + // (NULL, "Jeyone", "Female", 25), + // (NULL, "Saitama" , "Male", 24), + // (NULL, "Rogoue", "Female", 22), + // (NULL, "Dendimon","Male", 27), + // (NULL, "Minami", "Female", 18) + // `,data => { + // console.log("Data Players telah di input"); + // }) + // + // db.run(`INSERT INTO Cards + // VALUES(NULL, "Artoria Pendragon", "SSR", "Saber", "Excalibur", 1), + // (NULL, "Nero Claudius", "SR", "Saber", "Excalibur", 2), + // (NULL, "Fergus Mac Roich", "Common", "Saber", "Caladbolg", 3), + // (NULL, "Ryougi Shiki", "SSR", "Saber", "Boundary Of Emptiness", 4), + // (NULL, "Emiya", "SR", "Archer", "Unlimited Blade Words", 5), + // (NULL, "Arash", "Uncommon", "Archer", "Stella", 6), + // (NULL, "Orion", "SSR", "Archer", "Tri-star Amore Mio", 7), + // (NULL, "Arjuna", "SSR", "Archer", "Phasupata", 8), + // (NULL, "Chu Chulainn", "Common", "Lancer", "Gae Bolg", 9), + // (NULL, "Leonidas", "Uncommon", "Lancer", "Thermopylae Enomotia", 10), + // (NULL, "Brynhildr", "SSR", "Lancer", "Brynhildr Romantia", 2), + // (NULL, "Scatchach", "SSR", "Lancer", "Gae Bolg", 6), + // (NULL, "Saint Martha", "SR", "Rider", "Tarasque", 4), + // (NULL, "Francis Drake", "SSR", "Rider", "Golden Wild Hunt", 10), + // (NULL, "Medusa", "Common", "Rider", "Bellerophon", 1), + // (NULL, "Medea", "Common", "Caster", "Rule Breaker", 1), + // (NULL, "Zhuge Liang", "SSR", "Caster", "Unreturning Army", 2), + // (NULL, "Gilles de Rais", "Common", "Caster", "Prelati Spellbook", 1), + // (NULL, "Sasaki Kojiro", "Uncommon", "Assasin", "Swallow Reversal", 3), + // (NULL, "Cursed Arm Hassan", "Uncommon", "Assasin", "Zabaniya", 2), + // (NULL, "Heracles", "SR", "Berserk", "Nine Lives", 2), + // (NULL, "Lancelot", "SR", "Berserk", "Knight of Owner", 1), + // (NULL, "Artoria Pendragon", "SSR", "Saber", "Excalibur", 4), + // (NULL, "Nero Claudius", "SR", "Saber", "Excalibur", 3), + // (NULL, "Fergus Mac Roich", "Common", "Saber", "Caladbolg", 8), + // (NULL, "Ryougi Shiki", "SSR", "Saber", "Boundary Of Emptiness", 3), + // (NULL, "Emiya", "SR", "Archer", "Unlimited Blade Words", 8), + // (NULL, "Arash", "Uncommon", "Archer", "Stella", 9), + // (NULL, "Orion", "SSR", "Archer", "Tri-star Amore Mio", 10), + // (NULL, "Arjuna", "SSR", "Archer", "Phasupata", 7), + // (NULL, "Chu Chulainn", "Common", "Lancer", "Gae Bolg", 4), + // (NULL, "Leonidas", "Uncommon", "Lancer", "Thermopylae Enomotia", 1), + // (NULL, "Brynhildr", "SSR", "Lancer", "Brynhildr Romantia", 2), + // (NULL, "Scatchach", "SSR", "Lancer", "Gae Bolg", 5), + // (NULL, "Saint Martha", "SR", "Rider", "Tarasque", 3), + // (NULL, "Francis Drake", "SSR", "Rider", "Golden Wild Hunt", 3), + // (NULL, "Medusa", "Common", "Rider", "Bellerophon", 2), + // (NULL, "Medea", "Common", "Caster", "Rule Breaker", 1), + // (NULL, "Zhuge Liang", "SSR", "Caster", "Unreturning Army", 5), + // (NULL, "Gilles de Rais", "Common", "Caster", "Prelati Spellbook", 2), + // (NULL, "Sasaki Kojiro", "Uncommon", "Assasin", "Swallow Reversal", 3), + // (NULL, "Cursed Arm Hassan", "Uncommon", "Assasin", "Zabaniya", 7), + // (NULL, "Heracles", "SR", "Berserk", "Nine Lives", 5), + // (NULL, "Lancelot", "SR", "Berserk", "Knight of Owner", 7) + // + // `,data => { + // console.log("Data Cards telah di input"); + // }) + // // title point level playerId + // db.run(`INSERT INTO Status + // VALUES(NULL, "Beggar", 0, 10, 1), + // (NULL, "Vandal", 1220, 50, 2), + // (NULL, "Henchman", 8806, 76, 3), + // (NULL, "Greenhorn", 51595, 126, 4), + // (NULL, "Berserker", 462192, 241, 5), + // (NULL, "Hero", 16338232, 300, 6), + // (NULL, "Grunt", 230522, 210, 7), + // (NULL, "Novice", 87232, 160, 8), + // (NULL, "Apprentice", 113322, 182, 9), + // (NULL, "Rookie", 67292, 137, 10) + // `,data => { + // console.log("Data Bands telah di input"); + // }) - db.run(`INSERT INTO Players - VALUES - (NULL, "Fayola", "Male", 20), - (NULL, "Jerax", "Male", 24), - (NULL, "Hamabe", "Female", 18), - (NULL, "Matumbaman", "Male", 21), - (NULL, "Fiverna", "Male", 31), - (NULL, "Jeyone", "Female", 25), - (NULL, "Saitama" , "Male", 24), - (NULL, "Rogoue", "Female", 22), - (NULL, "Dendimon","Male", 27), - (NULL, "Minami", "Female", 18) - `,data => { - console.log("Data Players telah di input"); - }) + //Release 0 + // db.all(`SELECT title,point,level,name,age,gender + // FROM Status JOIN Players + // ON Players.id = Status.playerId + // ORDER BY level DESC`, (err,data) => { + // console.log(data); + // }) - db.run(`INSERT INTO Cards - VALUES(NULL, "Artoria Pendragon", "SSR", "Saber", "Excalibur", 1), - (NULL, "Nero Claudius", "SR", "Saber", "Excalibur", 2), - (NULL, "Fergus Mac Roich", "Common", "Saber", "Caladbolg", 3), - (NULL, "Ryougi Shiki", "SSR", "Saber", "Boundary Of Emptiness", 4), - (NULL, "Emiya", "SR", "Archer", "Unlimited Blade Words", 5), - (NULL, "Arash", "Uncommon", "Archer", "Stella", 6), - (NULL, "Orion", "SSR", "Archer", "Tri-star Amore Mio", 7), - (NULL, "Arjuna", "SSR", "Archer", "Phasupata", 8), - (NULL, "Chu Chulainn", "Common", "Lancer", "Gae Bolg", 9), - (NULL, "Leonidas", "Uncommon", "Lancer", "Thermopylae Enomotia", 10), - (NULL, "Brynhildr", "SSR", "Lancer", "Brynhildr Romantia", 2), - (NULL, "Scatchach", "SSR", "Lancer", "Gae Bolg", 6), - (NULL, "Saint Martha", "SR", "Rider", "Tarasque", 4), - (NULL, "Francis Drake", "SSR", "Rider", "Golden Wild Hunt", 10), - (NULL, "Medusa", "Common", "Rider", "Bellerophon", 1), - (NULL, "Medea", "Common", "Caster", "Rule Breaker", 1), - (NULL, "Zhuge Liang", "SSR", "Caster", "Unreturning Army", 2), - (NULL, "Gilles de Rais", "Common", "Caster", "Prelati Spellbook", 1), - (NULL, "Sasaki Kojiro", "Uncommon", "Assasin", "Swallow Reversal", 3), - (NULL, "Cursed Arm Hassan", "Uncommon", "Assasin", "Zabaniya", 2), - (NULL, "Heracles", "SR", "Berserk", "Nine Lives", 2), - (NULL, "Lancelot", "SR", "Berserk", "Knight of Owner", 1), - (NULL, "Artoria Pendragon", "SSR", "Saber", "Excalibur", 4), - (NULL, "Nero Claudius", "SR", "Saber", "Excalibur", 3), - (NULL, "Fergus Mac Roich", "Common", "Saber", "Caladbolg", 8), - (NULL, "Ryougi Shiki", "SSR", "Saber", "Boundary Of Emptiness", 3), - (NULL, "Emiya", "SR", "Archer", "Unlimited Blade Words", 8), - (NULL, "Arash", "Uncommon", "Archer", "Stella", 9), - (NULL, "Orion", "SSR", "Archer", "Tri-star Amore Mio", 10), - (NULL, "Arjuna", "SSR", "Archer", "Phasupata", 7), - (NULL, "Chu Chulainn", "Common", "Lancer", "Gae Bolg", 4), - (NULL, "Leonidas", "Uncommon", "Lancer", "Thermopylae Enomotia", 1), - (NULL, "Brynhildr", "SSR", "Lancer", "Brynhildr Romantia", 2), - (NULL, "Scatchach", "SSR", "Lancer", "Gae Bolg", 5), - (NULL, "Saint Martha", "SR", "Rider", "Tarasque", 3), - (NULL, "Francis Drake", "SSR", "Rider", "Golden Wild Hunt", 3), - (NULL, "Medusa", "Common", "Rider", "Bellerophon", 2), - (NULL, "Medea", "Common", "Caster", "Rule Breaker", 1), - (NULL, "Zhuge Liang", "SSR", "Caster", "Unreturning Army", 5), - (NULL, "Gilles de Rais", "Common", "Caster", "Prelati Spellbook", 2), - (NULL, "Sasaki Kojiro", "Uncommon", "Assasin", "Swallow Reversal", 3), - (NULL, "Cursed Arm Hassan", "Uncommon", "Assasin", "Zabaniya", 7), - (NULL, "Heracles", "SR", "Berserk", "Nine Lives", 5), - (NULL, "Lancelot", "SR", "Berserk", "Knight of Owner", 7) - - `,data => { - console.log("Data Cards telah di input"); - }) - // title point level playerId - db.run(`INSERT INTO Status - VALUES(NULL, "Beggar", 0, 10, 1), - (NULL, "Vandal", 1220, 50, 2), - (NULL, "Henchman", 8806, 76, 3), - (NULL, "Greenhorn", 51595, 126, 4), - (NULL, "Berserker", 462192, 241, 5), - (NULL, "Hero", 16338232, 300, 6), - (NULL, "Grunt", 230522, 210, 7), - (NULL, "Novice", 87232, 160, 8), - (NULL, "Apprentice", 113322, 182, 9), - (NULL, "Rookie", 67292, 137, 10) - `,data => { - console.log("Data Bands telah di input"); - }) + //Release 1 + db.all(`SELECT COUNT(*) AS totalcard, Cards.playerId, Players.name, Players.age, Players.gender + FROM Cards LEFT JOIN Players + ON Cards.playerId = Players.id + WHERE Players.gender = 'Male' + GROUP BY Players.name + ORDER BY totalcard DESC, Cards.playerId ASC + LIMIT 3`,(err,data) => { + console.log(data); + }) }); db.close(); From 4a08c81fb3091c5b61e7e8a52928be7bd7001a32 Mon Sep 17 00:00:00 2001 From: adhiartaputra Date: Fri, 23 Feb 2018 11:00:59 +0700 Subject: [PATCH 4/4] final release --- async/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/async/index.js b/async/index.js index 20fd247..1a817c8 100644 --- a/async/index.js +++ b/async/index.js @@ -75,14 +75,14 @@ function viewGachaFailure() { // RNG.gatchaRoll(5, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik // RNG.gatchaRoll(1, function(result) { viewGachaResult(result) }); // output log sesuai hasil random terbaik // RNG.gatchaRoll(0, function(result) { viewGachaResult(result) }); // output: 0 -// +// // // // RELEASE 1 TEST CASES // RNG.gatchaRollPromise(5) // .then(function(result) { viewGachaResult(result) }) // .catch(function(err) { viewGachaFailure() }); // // // akan menampilkan di log: YOUR BEST GATCHA ROLL RESULT IS -// +// // // RNG.gatchaRollPromise(0) // .then(function(result) { viewGachaResult(result) }) // .catch(function(err) { viewGachaFailure() }); @@ -107,6 +107,11 @@ promise10 = RNG.gatchaRollPromise(3) let arrOfPromise = [promise1,promise2,promise3,promise4,promise5,promise6,promise7,promise8,promise9,promise10] -Promise.all(arrOfPromise).then(promises => { - viewGachaResult(typeof promises) +Promise.all(arrOfPromise) +.then(promises => { + viewGachaResult(promises) + console.log(promises); +}) +.catch(err => { + console.log(err); })