**Create a function that will return a Boolean specifying if a number is prime. **

**Test with 1,5,6,7,9,11,13 & 27.**

What is a prime number in maths?

**Prime numbers** are special **numbers**, greater than 1, that have exactly two factors, themselves and 1. 19 is a **prime number**. It can only be divided by 1 and 19. 9 is not a **prime number**.

In our solution, we first check if the passed number is below 2. Then we already checked against any number below 2 being no prime number.

If the number is equal to 2, then it is a prime number and we can return true.

If any number passed both checks and we are still inside our function, then we find the maximum divisor by getting the square root of our passed number.

With a for loop, we check if the number is remainderless dividable by the iterator of i. If the remainder is 0, then we have definitely another valid calculation instead of only being able to divide a number with 1 and itself to be a prime number. Therefore, we are returning false.

Testifying the given numbers results into this printout.

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

One Reason Not to Migrate From JavaScript to TypeScript

Typescript saves a lot of development time, but is it worth an entire migrating process?

Upgrade Your Legacy Coding Style With These 6 Modern Ways of Coding

And How These 3 Famous TV Shows Make You Write Excellent JavaScript Code

]]>**Create a function that will find the nth Fibonacci number using recursion. **

**Fibonacci series: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … . Use nth = 14**

The Fibonacci numbers are the numbers in the following integer sequence.

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..

In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation

F_{n}= F_{n-1}+ F_{n-2}with seed values F_{0}= 0 and F_{1}= 1Examples:Input : n = 2 Output : 1 Input : n = 9 Output : 34 The solution is a simple method that is a direct recursive implementation mathematical recurrence relation given above.For Input: n = 14 Output: 377

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

One Reason Not to Migrate From JavaScript to TypeScript

Typescript saves a lot of development time, but is it worth an entire migrating process?

Upgrade Your Legacy Coding Style With These 6 Modern Ways of Coding

And How These 3 Famous TV Shows Make You Write Excellent JavaScript Code

]]>**Print the first 10 Fibonacci numbers without recursion. **

**Fibonacci series: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …**

We start with the creation of the for loop. We have to define the loop is running from 2 to 10 in order to get the first 10 numbers. We start with the 0 and the 1 and need 8 more.

Any number n of the **Fibonacci** series is created by adding up the number n-1 with the number n-2.

To get the third number, we need to have number n-1 and n-2. With n = 3, this will be number 2 and 1 of the series.

The equation is therefore:

n = n – 1 + n – 2;

Result into:

2 = 1 + 0; The 3rd number of the **Fibonacci** series.

Then we need to switch the n – 1 and n – 2 to the newly created ones to go further in our **Fibonacci** series. E voilá, do it as long as you want to get all numbers for the **Fibonacci** series.

The complete outcome of the console:

https://www.udemy.com/user/arnold-abraham-3/

5 Methods that drastically shorten drastically your Code in C# 8.0 by @ArnoldAbrahamP1 https://t.co/UlTW3H7bD9

— Kumpulin1 (@kumpulin1) May 5, 2021

]]>The reasons not to migrate from JavaScript to TypeScript! by @ArnoldAbrahamP1 https://t.co/tTjG6XG2nC #typescript #javascript #softwaredevelopement

— NFT (@nerdfortech) April 20, 2021

Find the maximum number in an array of numbers.

The array: [-21, 113, -34, 1, -9, 5, 99, 1, 0].

To accomplish our task, we create a function called `findMax()`

and pass in our array.

Inside the body, we need to create a variable referencing our found maximum value. We set the variable `max`

to the first element of our array. Since this it the first maximum existing. We didn’t check any other so far.

The next step is to loop over the array and check if the element we are currently looking at is greater than our current max value.

If so, replace it to the newly found maximum element of `array`

.

Once, we are done with iterating, comparing, and adding, just return the found maximum and print it to the console, and you are done!

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

5 Methods that drastically shorten drastically your Code in C# 8.0 by @ArnoldAbrahamP1 https://t.co/UlTW3H7bD9

— Kumpulin1 (@kumpulin1) May 5, 2021

]]>The reasons not to migrate from JavaScript to TypeScript! by @ArnoldAbrahamP1 https://t.co/tTjG6XG2nC #typescript #javascript #softwaredevelopement

— NFT (@nerdfortech) April 20, 2021

Create a function that receives an array of numbers and returns an array containing only the positive numbers.

The array: [-65, 11, -5, 1, -19, 45, 19, 0, 1].

To accomplish our task, we create a function called `getPositives()`

and pass in our array.

Inside the body, we need to create a new array (`tempArray`

), to keep only the positives inside.

The next step is to loop over the already existing array and check if the element we are currently looking at is positive.

If so, add it to the newly created array of `tempArray`

.

Once, we are done with iterating, checking and adding, just return the array and print it to the console, and you are done!

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

5 Methods that drastically shorten drastically your Code in C# 8.0 by @ArnoldAbrahamP1 https://t.co/UlTW3H7bD9

— Kumpulin1 (@kumpulin1) May 5, 2021

]]>The reasons not to migrate from JavaScript to TypeScript! by @ArnoldAbrahamP1 https://t.co/tTjG6XG2nC #typescript #javascript #softwaredevelopement

— NFT (@nerdfortech) April 20, 2021

Calculate the average of the numbers in an array of numbers. The array: [2, 5, 17, 81, 9].

A calculated „central“ value of a set of numbers.

To calculate it: add up all the numbers, then divide by how many numbers there are.

Example: what is the average of 2, 7 and 9?

Add the numbers: 2 + 7 + 9 = 18

Divide by how many numbers (i.e. we added 3 numbers): 18 ÷ 3 = 6

So the average is 6

(Also called the Arithmetic Mean.)

To accomplish our task, we create a function called `averageArray()`

and pass in our array.

We need to get the length of the array for our for-loop. Creating a sum and then dividing by the length gets our average.

Just return the number and print it to the console, and you are done!

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

Calculate the sum of numbers in an array of numbers. The array: [1, 9, -19, 3, 5, 3, 7, 14, 91].

To accomplish our task, we need to iterate over the array and build the sum out of each element.

Since we aren’t so experienced right now, we should not use the reduce() function. Instead, we write basic operations like this with a for loop

After the loop has finished, we print it out to the console:

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

Create a function that will convert from Fahrenheit to Celsius. Convert -38 degree Fahrenheit.

The temperature *T* in degrees Fahrenheit (°F) is equal to the temperature *T* in degrees Celsius (°C) times 9/5 plus 32:

*T*_{(°F)} = *T*_{(°C)} × 9/5 + 32

or

*T*_{(°F)} = *T*_{(°C)} × 1.8 + 32

Convert 20 degrees Celsius to degrees Fahrenheit:

*T*_{(°F)} = 20°C × 9/5 + 32 = 68 °F

To accomplish our task, we need to reverse the conversion of degrees to Fahrenheit. This means we first subtract 32 and then divide by 1.8.

This is done in the * convertFahrenheitToCelsius*-function.

Just return the number and print it out, and you are done!

The console prints out -38.888888888888886 when we put in the number -38.

Because this is the point where Celsius and Fahrenheit have the same amount.

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

Create a function that will convert from Celsius to Fahrenheit. Convert 0 degree Celsius.

The temperature *T* in degrees Fahrenheit (°F) is equal to the temperature *T* in degrees Celsius (°C) times 9/5 plus 32:

*T*_{(°F)} = *T*_{(°C)} × 9/5 + 32

or

*T*_{(°F)} = *T*_{(°C)} × 1.8 + 32

Convert 20 degrees Celsius to degrees Fahrenheit:

*T*_{(°F)} = 20°C × 9/5 + 32 = 68 °F

To accomplish our task, we need to return a number calculated with 1.8 and add 32 to it.

This is done in the `convertCelsiusToFahrenheit`

-function.

Just return the number and print it out, and you are done!

The console prints out 32 when we put in the number `0`

.

https://www.instagram.com/arnold.code/

https://www.udemy.com/user/arnold-abraham-3/

Calculate the sum of odd numbers greater than 9 and less than 30 a `for-loop`

.

To accomplish our task, we should remember challenge #02 because back then, the task was to print out every odd number below 99. That means we create a for loop with an increment of 2 after each iteration to get only odd numbers when starting with an odd number. In our case with 11.

Remembering challenge #05 makes us also happy again. There we had the task to create the sum of the numbers from 1 to 24. The same concept applies to this task. We add up every odd number above 9 and below 30 to a sum.

After the loop has finished, we print it out to the console:

Follow me on Instagram and don’t miss the latest Challenge!

https://www.instagram.com/arnold.code/

Here are two pre-picked and high quality Medium articles for you.

Quick 3-Minute Guide for the Monday Morning about https://t.co/thEjiQhZR6() @JS_PlainEnglish https://t.co/thEjiQhZR6() https://t.co/Fg4ky3xvn9 #javascript #learning #coding #Frontend #Developer #programmer #Guide #tutorial #Fastlane #QuickHits #easyaccess #learntocode

— ArnoldCode (@ArnoldAbrahamP1) March 29, 2021

]]>Document object model Free DOM Guide for everyone!https://t.co/yjO6OMy3uy#HTML #html5 #htmlcss #htmlcode #htmlemail #htmlcoding #medium #tutorial #Tutorials #WritingCommunity #webdesign #website #web #webdesigner #webdevelopment #WebDeveloper #code #coder #CodersTeach #coder

— ArnoldCode (@ArnoldAbrahamP1) December 23, 2020