function arrSum(array) {
let sum = 0
function recur (array){
if (Array.isArray(array)) {
array.map(val => {
if(Array.isArray(val)) {
recur(val)
} else {
sum += val
}
})
}
}
recur(array)
return sum
}
let arr = [[1, [4,6]], [3, 4], [5, 6]]
let totalSum = arrSum(arr) \\ => 29
Intent intent;
if (!isExistToken()) {
intent = new Intent(this, LoginActivity.class);
} else {
intent = new Intent(this, MainActivity.class);
}
startActivity(intent);
finish();
[
[
{
time: "12:30",
name: "someName",
lastName: "someLastName"
},
{
time: "12:30",
name: "someName2",
lastName: "someLastName2"
}
],
[
{
time: "13:15",
name: "someName3",
lastName: "someLastName3"
},
{
time: "13:15",
name: "someName4",
lastName: "someLastName4"
}
]
]