NEED EXPLANATION FOR OUTPUT PLEASE | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

NEED EXPLANATION FOR OUTPUT PLEASE

c5 : function(){ let Lang = ['java', 'C', 'C++', 'C#', 'python']; let x = Lang.pop(); let y = Lang.push('koltin'); console.log(x); // output => python console.log(y); // output => 5 console.log(y+x); // output => 5python }

8th Jan 2019, 2:48 PM
Phillip Mark England
Phillip Mark England - avatar
1 Answer
+ 4
pop() Removes the last element of an array, and returns that element push() Adds new elements to the end of an array, and returns the new length source:(W3Schools)https://www.w3schools.com/jsref/jsref_obj_array.asp
8th Jan 2019, 3:11 PM
ODLNT
ODLNT - avatar