Answers for "how to turn mapped data into upper case react"

0

how to turn mapped data into upper case react

{
  filteredData.map((value) => {
    let { id, email, first_name, last_name } = value;

    //Capitalizing first char of first and last name
    const firstName =
      first_name.charAt(0).toUpperCase() + first_name.substring(1);
    const lastName = last_name.charAt(0).toUpperCase() + last_name.substring(1);

    return (
      <>
        <div>{email}</div>
        <div>{firstName}</div>
        <div>{lastName}</div>
      </>
    );
  })
}
Posted by: Guest on April-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language