This is a short story about a girl named Karen and her friend. Run index.html
to view the story. You will see that the story is incomplete. On finishing each Trial, a part of the story will be unlocked. Go to the src/app.js
file and complete all the unfinished code to find out how this story ends.
Fork this repo
Clone this repo
Practice JavaScript Basics - Datatypes, Operators, Conditions
Upon completion, run the following commands:
git add .
git commit -m "ProGrad ID"
git push origin master
And finally, create a pull request so your ProGrad Mentor (PM) can review your work.
Open the SpecRunner.html
file on your browser and start coding to pass the test. Remember to focus on one test at a time and read carefully the instructions to understand what should be done.
We've got some basic information about Karen's home. Find out the type of each data. Create a function moreAboutHome()
which takes address, distanceFromTown, hasNeighbours
as arguments and returns all datatypes concatenated in a single variable.
Now, we're given some more information about Karen's family. Create a function moreAboutKaren()
that takes parents, noOfSiblings, isNuclearFamily
as arguments. Check if the arguments passed are of the datatypes String, Number, Boolean
respectively and return true/false accordingly.
Karen says she's made a new friend but Lily (Karen's Mom) doesn't believe her yet. create a function doesFriendExist()
that takes ageInText, ageInNumber
as arguments. It checks which of the given value is NaN
and returns the value.
Lily gave Karen some sweets in order to calm her down so she could follow her. Lily has a sweet tooth and couldn't resist the temptation. She ate a lot of them on her way to the river.
-
Lily gave Karen x sweets
-
Karen ate y sweets herself
-
She ate another z sweets every n meters travelled
-
Her friend divided the remaining sweets into 2 parts for each of them.
Create a function
sweetTooth()
which takestotalNoOfSweets, sweetsConsumedByKaren, sweetsConsumedInNMeters, metersToTravel
as arugments and return number of sweets Karen's friend would have.
Lily stalks Karen slowly, making sure not to alert her. Suddenly, a gust of wind sends a chill down her spine. She feels the temperature dropping and checks her phone. It displays the temperature in fahrenheit. Create a function convertToCelsius()
which takes an argument fahrenheit
and returns the temperature in celcius.
Lily starts panicking once she reaches. She feels there's something wrong with her and requires immediate medical attention. She cannot decide what to do next. How to fix this without hurting her child any further. Create a function aDifficultChoice()
which takes an argument choice
and returns the corresponding choice.
Lily's actions had a negative effect on Karen and now she's drifted further away. Lily realizes that she must do something immediately to console her daughter. She thinks of a couple of strategies that might help. Create a function consoleKaren()
which takes an argument strategies
. Concatenate these strategies and returns the string length.
This lab is inspired by Mysterious Friend - yourstoryclub.com
Happy Coding ProGrad ❤️