This is the array that i tried working with :
let array = [
"getX",
"getY",
"getZ",
"getRotationX",
"getRotationY",
"getRotationZ",
"getRotation"];
I tried different ways , but coudn't acheieve so , I want to arrange analogus valuegetx, gety, getz into one subarray, same goes for rotation and scale. Does anyone have idea on how to proceed ?
output: const array = [['getY','getX','getZ'], ['getPositionX'....],...];
Top comments (4)
If your JS environment support Array#flatMap, you can do a simple regex match.
If not, then you'd have to flat the result of regex's match value (as
.match
returns an array of values)thankyou :)
You're welcome~
thankyou so much kim :)