daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. const _ = require('lodash');
  4.  
  5.  
  6. const goku = {
  7.   name: 'Goku',
  8.   color: 'blue',
  9. };
  10.  
  11. const A21 = {
  12.   name: 'Android 21',
  13.   color: 'green'
  14. };
  15.  
  16. const vegeta = {
  17.   name: 'Vegeta',
  18.   color: 'yellow'
  19. };
  20.  
  21. const combos = {
  22.   green: {
  23.     notation: '2M 5M x Kamehameha',
  24.     damage: 1392
  25.   }, blue: {
  26.     notation: '2M 5M x Bombs',
  27.     damage: 1934
  28.   }, yellow: {
  29.     notation: '2M 5M x Command Grab',
  30.     damage: 1002
  31.   }
  32. };
  33.  
  34. let team = [goku, A21, vegeta];
  35. let maxDmg = _.maxBy(team, character => {
  36.   return combos[character.color].damage;
  37. });
  38.  
  39. console.log(`Max damage from the enemy team is from ${maxDmg.name}.`);
RAW Paste Data
Top