MWR InfoSecurity Interview Question

How would you create a JS framework?