Concatenation Value Calculation
Given an array of integers, you start with an initial concatenation value of 0. You repeatedly perform the following operation until the array becomes empty: if there are more than one number in the array, you concatenate the first and last elements and add the result to the concatenation value, then remove these elements from the array. If there's only one element, you add its value to the concatenation value and remove it. Finally, print the concatenation value.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)