Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object loop javascript

 const shots = [
            {id: 1, salary:100,name:'Win Win Maw',position:'junior'},
            {id: 2, salary:130,name:'Mg Mg',position:'junior'},
            {id: 3, salary:200,name:'KO KO',position:'senior'},
            {id: 4, salary:90,name:'Hla Hla',position:'intern'},
            {id: 5,  salary:250,name:'Ni Lar',position:'senior'},
            ];


            //increment Salary by percentage
                let salaries = shots.map((e)=>{
                    return e.salary
                })

                let percent = 5 ;
                salaries.forEach(increaseSalary => {
                    increaseSalary += (increaseSalary * percent) / 100;
                    console.log(increaseSalary);
                }); 
Source by www.webmound.com #
 
PREVIOUS NEXT
Tagged: #object #loop #javascript
ADD COMMENT
Topic
Name
3+7 =