Typescript Find Element In Nested If Command