Answer the question
In order to leave comments, you need to log in
What does [2] do in the given .match?
There is this code:
host_uri.path().match(///^\/([a-z]*\/[a-z].*?\/[a-z].*?)-(.*).*///)[2]
Answer the question
In order to leave comments, you need to log in
[2] does not apply to the regular season at all. This is an array element selection. Since match
in JS (and in all implementations) it returns an array, you simply select the 3rd element. That is:
/^\/([az]*\/[az].*?\/[az].*?)- (.*)
.*/
What you have there is known only to you.
But now you are trying to take the second 3rd element from Null
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question