This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect } from 'react'; | |
| import { DefaultValues, FieldValues, Resolver, useForm, UseFormReturn } from 'react-hook-form'; | |
| interface UsePersistedFormOptions<TFormValues extends FieldValues> { | |
| formId: string; | |
| defaultValues?: DefaultValues<TFormValues>; | |
| schema?: Resolver<TFormValues>; | |
| } | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parms = [{ | |
| "cmd": "aCommandName", | |
| "desc": "A DOMString representing the name of the command" | |
| }, { | |
| "cmd": "aShowDefaultUI", | |
| "desc": "A Boolean indicating whether the default user interface should be shown. This is not implemented in Mozilla." | |
| }, { | |
| "cmd": "aValueArgument", | |
| "desc": "A DOMString representing some commands (such as insertimage) require an extra value argument (the image's url). Pass an argument of null if no argument is needed." | |
| }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** ANOTHER SOLUTION AFTER EXPLORING / GOOGLE */ | |
| function standarizedString(word) { | |
| if (typeof word === 'string') { | |
| return word.toLowerCase().replace(/[^a-z\d]/g,'').split('').sort().join(''); | |
| } | |
| } | |
| function checkAnagramV2 (firstString, secondString) { | |
| return standarizedString(firstString) === standarizedString(secondString) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** ORIGINAL SOLUTION */ | |
| function countLetter(letter, words) { | |
| const regExpLetter = new RegExp(letter, 'g'); | |
| let result = words.match(regExpLetter); | |
| if (result) { | |
| return result.length | |
| } | |
| return result; | |
| } | |
| function checkAnagram(firstString, secondString) { |