var arr = [1,2,3,4];
I need to get the last one and then remove it from an array named arr :
arr
var arr = [1,2,3]
You want to do exactly what pop does:
pop
var arr = [1,2,3,4]; //... var last = arr.pop(); // returns 4, and arr will contain now [1, 2, 3]
Source: https://habr.com/ru/post/1299547/More articles:Software to generate SQL proc diagrams in a program thread - sqlTriple UISwitch - iphoneChange the ANSI_NULLS parameter for all stored procedures in the database - sql-serverSQL Server: how to generate object scripts without DMO / SMO? - scriptingDjango - custom widget with "you mean" prompts based on validation - ajaxNested Linux kernel structure viewer - eclipseUsing KWallet in PyQt4 - pythonJava 1.6 Windows-1252 encoding fails by 3 characters - javaANTLR, how to detect garbage data at the end of input - inputIs this code for string interning described? - stringAll Articles