Skip to main content
Don't need to scream, just bold the sentence instead of capitalize it.
Source Link
Maxime Lorant
  • 36.4k
  • 19
  • 91
  • 97

You can also .pop off the last element. THIS WILL CHANGE THE VALUE OF THE ARRAY. ButBe careful, this will change the value of the array, but that might be OK for you.

var a = [1,2,3]; a.pop(); // 3 a // [1,2] 

You can also .pop off the last element. THIS WILL CHANGE THE VALUE OF THE ARRAY. But that might be OK.

var a = [1,2,3]; a.pop(); // 3 a // [1,2] 

You can also .pop off the last element. Be careful, this will change the value of the array, but that might be OK for you.

var a = [1,2,3]; a.pop(); // 3 a // [1,2] 
Source Link
Josh
  • 8.6k
  • 5
  • 38
  • 35

You can also .pop off the last element. THIS WILL CHANGE THE VALUE OF THE ARRAY. But that might be OK.

var a = [1,2,3]; a.pop(); // 3 a // [1,2]