Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Assign Default Values

let arrValue = [10];

// assigning default value 5 and 7
let [x = 5,  y = 7] = arrValue;

console.log(x); // 10
console.log(y); // 7
 
PREVIOUS NEXT
Tagged: #javascript #Assign #Default #Values
ADD COMMENT
Topic
Name
4+8 =