#randomteams
Explore tagged Tumblr posts
Photo
Don't you know how to make the teams? Generate them fast and easy with RandoMaster! Install the FREE app from Google Play 🤞http://bit.ly/2OeLphf
0 notes
Text
[JS] 陣列操作實務範例
Array操作系列文:http://chilin99999.tumblr.com/tagged/array%E6%93%8D%E4%BD%9C
這篇文章,舉幾個比較貼近實務的case,與大家分享。
如果大家想對Array做什麼害羞的事(?),可以在底下留言。
版主會的話就將其補上~
let data = { title: 'Javascript超級大亂鬥', players: { teamA: [ { name: 'David', age: 18, score: 6688, }, { name: 'Peter', age: 16, score: 5689, } ], teamB: [ { name: 'Kelly', age: 62, score: 7566, }, { name: 'Diana', age: 24, score: 4089 } ] }, };
情境1:找出Diana是否為玩家
data.players.teamA.concat(data.players.teamB).some(d => d.name === 'Diana'); // true
情境2:從players清單中刪除Peter
Object.keys(data.players).forEach((key) => { let team = data.players[key]; let index = team.map(d => d.name).indexOf('Peter'); if(index > 0) team.splice(index, 1); });
情境3:找出分數最高的玩家
data.players.teamA.concat(data.players.teamB).reduce((pre, cur) => { return pre < cur ? pre : cur; }); // {name: "Diana", age: 24, score: 4089}
情境4:將新成員Tom隨機加入某隊
let playerTom = { name: 'Tom', age: 87, score: 8787, }; let randomTeam = Math.floor((Math.random()) + 1) ? 'teamA' : 'teamB'; data.players[randomTeam].push(playerTom);
0 notes
Photo
Save your time when generating random teams or when you want to pick a random item from a list with RandoMaster! Check it out now on Google Play, is free -> http://bit.ly/2OeLphf
0 notes
Photo
Generate random teams faster and easier with RandoMaster! Get the FREE app now from Google Play http://bit.ly/2OeLphf
0 notes
Photo
Use RandoMaster to pick the next WINNER! Download the FREE app now, from Google Play http://bit.ly/2OeLphf
0 notes
Photo
When you are in lack of inspiration and you don't know what numbers to pick, just use your new app RandoMaster! Get it now from Google Play http://bit.ly/2OeLphf FREE
0 notes
Photo
The end of the month is here and also A NEW APP! Check it out now on Google Play! RandoMaster - Random Generator http://bit.ly/2OeLphf
0 notes
Photo
You want to play a board game with your friends and you need to make the teams fast? Maybe RandoMaster will be in handy for that! Get it now from Google Play http://bit.ly/2OeLphf
0 notes
Photo
If you need to generate random numbers, random teams or pick a random person from a list than you should get RandoMaster. Download it now from Google Play, it's FREE http://bit.ly/2OeLphf
0 notes
Photo
Generate random teams faster and easier with RandoMaster App! Download it now from Google Play http://bit.ly/2OeLphf
0 notes
Photo
You best companion when playing board games with your friends! Get the RandoMaster now from Google Play http://bit.ly/2OeLphf #boardgames
0 notes