JSFiddle - React, Tailwind, and code Playground

HTML

<script>
    first_name = 'Andrew  ';
    first_name = first_name.trim();
    if (first_name.match(/^Andrew$/)) alert('match');
    else alert('no match');
</script>