JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = '200:java'

alert(x.split(':')[0])