Skip to content

Tag: string

check that a word is an isogram with pure javascript

How do i check that a given word is an isogram with pure javascript, using a function. the function must return true or false. An isogram is a word with a repeated character. I know this code works, but i need a better solution. Answer Here is a simple approach using .split() and .every(): Docs: String.protot…

How to parse JSON string in Typescript

Is there a way to parse strings as JSON in TypeScript? For example in JavaScript, we can use JSON.parse(). Is there a similar function in TypeScript? I have a JSON object string as follows: Answer TypeScript is (a superset of) JavaScript, so you just use JSON.parse as you would in JavaScript: Only that in Typ…