Consider following snippet:

var colors = ["red ","blue ","green ","pink "];
colors.pop();
colors.push("orange");
console.log(colors);
What will be printed to the console?
Explanation
array.pop() removes the last element in array and return that element. array.push() method add new element to array.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты