easierbycode
4/26/2016 - 9:31 PM

destructuring-with-default-value.js

'use strict';
let salary = ['32000', '50000'];
[low, average, high = '90000'] = salary;

console.log( high )
// 90000


function reviewSalary([low, average], high = '90000') {
 console.log( average ); 
}

reviewSalary(['32000', '50000'])
// 50000