Question: Super Simple Ruby/Javascript Program. Please provide exact details of what each string means with intricate details and comments. Clarify the logic behind each line of

Super Simple Ruby/Javascript Program.

Please provide exact details of what each string means with intricate details and comments. Clarify the logic behind each line of code.

1. With a string, report the number of occurrences that a specific character appears.

No punctuations, grammar, or capitalization involved

Example : a sentence of 'aaabbc' would return { 'a': 3, 'b': 2, 'c': 1 }

another example 'you are not here' and it would count each letter.

2, With a list of words, sort them by length, and alphabetically if length is the same.

Example: ['cool', 'apple, dinosaur, fire '] would return ['apple', 'cool', 'dinosaur', 'fire']

Again, please describe in words why the program is written that specific way.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!