/reto-viva

Primary LanguageJavaScript

Reto Viva M2W1 Platzi Master


Description

In this week i learned how to use closures in js. In this challenge i recived the followinf instructions and i had to code a solution using closures:

Crea una cartera de cliente Premium para la empresa VIVA, en la cual los cliente podrán acumular estrellas por cada transacción realizada en la empresa.

The closure have two methods. getEstrellas() and addEstrellas(validation,number)

getEstrellas()

Do not recive parameters and return the number of stars in the wallet, the default amount is 0

addEstrellas(validation,number)

Recive two parameters. validation = boolean and a number = integer

If validation = true then you can add stars, and number indicates how much stars will be added. the default amount is 1