Welcome to your first exercise. While I am going to assume you have Node and Yarn installed on your computers, and you have basic knowledge of Git, I am going to explain step by step how to get everything set-up and how to get "unit tests" running.
- Node
- Yarn
- Git
- We need to open our Terminal and navigate to the folder where we want to save our exercises. (Some of the key commands for navigation in Unix systems are
cd
andls
) - Once you are in the right directory, you are going to
git clone
the repo. Running this command will download the repository into the current directory.
git clone https://github.com/reneloperena/elements-of-js-functions-p1.git
- Navigate inside the folder
- Run
yarn
to install our dependencies. This repository uses libraries such as Jest and Babel; we'll learn more about JavaScript modules in the future, for now, know that everytime you download a Repo, you need to runyarn
to download its dependencies.
yarn
- To run the tests, you can run our test script using
yarn run test
- Start modifying the
hello.js
file until all tests pass.
- In
hello.js
you need to define a function calledsayHello
that takes a name as a parameter and returns the string'Hello {name here}!'
. - In
temperature.js
:
- Define a function named
fahrenheitToCelcius
which will take a value (number) in degrees fahrenheit and convert it to celsius - Define a function named
celsiusToFahrenheit
which will do the same as the previous function but convert it from celsius to fahrenheit. - Define a function named
friendlyCelsiusToFahrenheit
which will take a value in celsius and convert it to a string that contains the following: '{value in C} Celsius equals to {value in fahrenheit} Fahrenheit'
- (BONUS) Find out what are Template Literals in JavaScript and change your code to use them. (Mozilla Developer Network is a great place to find information about JavaScript)