JavaScript Taskbook Level 2.6

Задание 1

Given a string of letters and numbers, get an array of positions of all the digits in that string.

Задание 2

Given an array with some numbers, for example, like this:

javascript[123, 456, 789]

Write code that will reverse the numbers in this array as follows:

javascript[321, 654, 987]
Задание 3

Given a string with a number:

javascript'1234567'

Separate the triplets of numbers with spaces, starting from the end of the number. In our case, we should get the following:

javascript'1 234 567'
Задание 4

A certain line is given:

javascript'AbCdE'

Change the case of the letters in this line to the opposite. In our case, it should look like this:

javascript'aBcDe'
Задание 5

Given some array of numbers, for example, like this:

javascript[1, 2, 3, 4, 5, 6]

Merge pairs of elements together:

javascript[12, 34, 56]
Задание 6

There is a certain line with the words:

javascript'aaa bbb ccc eee fff'

Capitalize the first character of every other word in that line. In our case, it should look like this:

javascript'aaa Bbb ccc Eee fff'