JSFiddle - React, Tailwind, and code Playground

JavaScript

var types = {
  "WHITE" : 0,
  "BLACK" : 1
}

var typeArray = Object.keys(types).map(function(type) {
    return types[type];
});

alert(typeArray);