I have an array of objects as shown below. I did a console.log(values); and got below result
["15- S&P", "us- ex US", "al- ex CL"]
0:"15- S&P"
1:"us- ex US"
2:"al- ex CL"
length:3
__proto__:Array(0)
I want the output in a array with values as follows.
[S&P, ex US, ex CL]
All values before the '-' are eliminated and values after '-' are taken and put in an array. for e.g. '15- S&P' is changed to 'S&P'. Can anyone please let me know how to achieve this.
["15- S&P", "us- ex US", "al- ex CL"].map(s => s.match(/- (.*)/).pop())