JSFiddle - React, Tailwind, and code Playground

JavaScript

var user_types = ["student","parent","employee"];
var types = {};

$.each(user_types, function( index, value ){
  types[value] = 'The value of dynamic variable, val';
});

console.log(types);