JSFiddle - React, Tailwind, and code Playground

JavaScript

var user_types = ["student1","parent2","employee3"];
var types = {};
for(var i=1; i<=3; i++){
types[value+i] = 'The value of dynamic variable, val';
}

console.log(types);