siva nathan

siva nathan

  • 953
  • 828
  • 233.2k

convert string to boolean in angular typescript

Dec 22 2020 7:45 AM
Hi All,
 
i have an list of array object need to convert string values into bool
 
ex: array below mentioned
 
0: {roleName: "Admin", roleId: 14, configuration: "false", projects: "false", fTs: "false", …}
1: {roleName: "PM", roleId: 15, configuration: "false", projects: "false", fTs: "false",...}
 
expected result
 
0: {roleName: "Admin", roleId: 14, configuration: false, projects: false, fTs: false, …}
1: {roleName: "PM", roleId: 15, configuration: false, projects: false, fTs: false,...}
 
need to convert above array object string into bool how to achieve this

Answers (2)