1 The `pop()` function removes the last element of the given source array. 2 3 Returns the removed value. 4 5 Returns `null` if the given source argment is not an array. 6 7 Throws a type exception if the given array is immuatable. 8 9 -- Testcase -- 10 {% 11 let arr = [ 1, null, 3 ]; 12 13 printf("%.J\n", [ 14 // remove one element 15 pop(arr), 16 17 // remove a null element 18 pop(arr), 19 20 // invalid source 21 pop({ test: true }) 22 ]); 23 24 printf("%.J\n", arr); 25 %} 26 -- End -- 27 28 -- Expect stdout -- 29 [ 30 3, 31 null, 32 null 33 ] 34 [ 35 1 36 ] 37 -- End --
This page was automatically generated by LXR 0.3.1. • OpenWrt