Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const _ = require('lodash');
- const goku = {
- name: 'Goku',
- color: 'blue',
- };
- const A21 = {
- name: 'Android 21',
- color: 'green'
- };
- const vegeta = {
- name: 'Vegeta',
- color: 'yellow'
- };
- const combos = {
- green: {
- notation: '2M 5M x Kamehameha',
- damage: 1392
- }, blue: {
- notation: '2M 5M x Bombs',
- damage: 1934
- }, yellow: {
- notation: '2M 5M x Command Grab',
- damage: 1002
- }
- };
- let team = [goku, A21, vegeta];
- let maxDmg = _.maxBy(team, character => {
- return combos[character.color].damage;
- });
- console.log(`Max damage from the enemy team is from ${maxDmg.name}.`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement