I want to use this code to generate String.
randomString(): string {
const length = 40;
const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let result = '';
for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
But I get this error:
TSLint: for statements must be braced (curly)
Do you know in typescript what braces should I use?