Volume de uma caixa

Published by Alon in

Crie uma função que recebe um objeto sizes como argumento (contém as chaves width, length, height) e retorna o volume da caixa.

Exemplos

volumeOfBox({ width: 2, length: 5, height: 1 }) ➞ 10

volumeOfBox({ width: 4, length: 2, height: 2 }) ➞ 16

volumeOfBox({ width: 2, length: 3, height: 5 }) ➞ 30

Notas

  • Não se esqueça de usar return para retornar o resultado.
  • Lembre-se de que os valores estão em um objeto.
  • O volume é comprimento * largura * altura.