Step 11

JavaScript provides a more compact syntax for writing functions, particularly when provided as an argument to other functions.

const cnumber = "4003600000000014";

let arr = cnumber.split('');

arr = arr.reverse();

arr = arr.map(element => parseInt(element));

console.log(arr);

The syntax exhibited above is known as the "arrow function." We will cover arrow functions in the next chapter.

Moreover, we can write the operations performed on the arr one after another, like a pipeline, as shown below:

const cnumber = "4003600000000014";

let arr = cnumber
  .split('')
  .reverse()
  .map(element => parseInt(element));

console.log(arr);