I got below test as a part of my job interview and I know how to reverse a string but don’t know how to reverse every third word in a string.
Using ES5 or ES6, write a function ‘reverseStringWords’ that will reverse every **third** word in a string. The string will only contain a single space between words and there will be no punctuation.
string (london glasgow manchester edinburgh oxford liverpool)
string (manchester lonodn glasgow liverpool edinburgh oxford)
Your help would be much appriciated.