JavaScript fun question: Did you get a bonus?
Feb 13, 2017 pm 04:09 PMIt’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, bonus is a Boolean value.
If bonus is true, then the salary is multiplied by 10!
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 (www.php.cn)!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Replace String Characters in JavaScript

Custom Google Search API Setup Tutorial

8 Stunning jQuery Page Layout Plugins
