This code calculates the percentages of presence of script names within a a string.
This project made me extremely familiar with higher order functions. I used several functions to iterate through each string character, determine what script name it corresponds to from its ranges property, count the occurence of each script type with the iteration process through the string, calculate the percentages of each script name within the string!
The code uses a source of data that has an array of objects data structure.
Comments were added, especially at the final function to better understand the process of calculations.
Project inspired by:
Haverbeke, Marijn. Eloquent JavaScript, 3rd Edition No Starch Press.
Running the program:
Download the source code. Make note of the path it was downloaded in.
Read the source code with the comments on GitHub, your favorite text editor or IDE!
If you are running mac os as I am, simply install node.js.
In terminal type: node /Users/username/Downloads/05_10.js
Look at the outputs and re-run the program to see that any input in the source code generates the right output on the console!
Thank you!