Relative Content

Tag Archive for javascriptfunction

How make a validator for a parent function?

Im making a web site which encrypt texts and decrypt them, already I managed asignning the funcionalities to the buttons and enclose this functions into a parent function with the finality that the user only can use the web site after do click in “aceppt thte terms of use” (with a checkbox), so all good at this point beacuse I bond this button as well but I found that after the first click in the button dosent matter if this isnt mark anymore the parent function dont “return”.

The function sumAscii should take an array of names and calculate each name’s score based on the total of each character’s lowercase ASCII value

The function sumAscii should take an array of names and calculate each name’s score based on the total of each character’s lowercase ASCII value. It should return the name with the highest score. E.g. The name ‘John’ would get the score 431 because ‘j’ has the ASCII code 106, ‘o’ has the ASCII code 111, ‘h’ has the ASCII code 104 and ‘n’ has the ASCII code 110.