• 25 May

    Type ‘String’ cannot be used as an index type in Typescript

    In this post, we will see how to fix error Type ‘String’ cannot be used as an index type in Typescript. Type ‘String’ cannot be used as an index type in Typescript occurs when you use String(Starts with capital s) instead of string when trying to index array or object in Typescript. Let’s see with […]

  • 21 May

    How to Clear Array in TypeScript

    In this post, we will see how to clear array in Typescript. There are multiple ways to do it. Let’s go through them. 1. By setting array’s length to 0 To clear array in TypeScript: Set length of array to 0. When length property is changed, all the elements that have index larger than its […]