I've created a function that takes in a variable and returns the last value in the variables array. How do I push multiple variables arrays to go through the function? It works for var arr but not pzz?
var arr = ['abc', 'def', 'ghi'];
var pzz = ['jkl', 'lmn', 'opq'];
function valueIn(v) {
vLength = v.length;
console.log(v[vLength-1]);
}
valueIn(arr);
[arr, pzz].forEach(valueIn)const myArrs = [arr, pzz];valueIn([...arr,...pzz])let obj = {arr, pzz}, then getobj.arr, or use one of theObjectmethods to iterate through them.