It’s time to distribute project bonuses!
The boss asked you to write a program for him to use. Then after you read the design document, your eyes widened in surprise.
It turns out that this program is to write a function, which receives two parameters, salarysalary, and whether there is a bonusbonus.
Salary is an integer,bonusis a Boolean value.
Ifbonusistrue, then the salary is multiplied by10!
Otherwise, the salary remains intact.
Returns a salary string starting with the soft girl currency symbol"¥".
Well, after a busy day, it’s not a bad idea to use this topic for leisure and entertainment.
Then get it done quickly!
function bonusTime(salary, bonus) { bonus = bonus ? 10 : 1; return "¥" + bonus * salary; }
The above is a fun JavaScript question: Did you get a bonus? Content, for more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!