I want to import a specific variable from another Javascript file. I now do this the standard way.
For example, I have a validation.js file where I have the following code:
export const profile = {...}
My problem is that I want to import this variable from another file by variable name:
import {profile} from "validation" //this will work
But this
let action = 'profile';
import {action} from "validation" // this will surely look for action in validation.js and not profile.
How can I import the right variable by using the action string?