# Floundering with JavaScript task - HELP! I'm drowning

**URL:** <https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055>\
**Category:** General\
**Created:** [January 16, 2017, 4:25am UTC](https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055 "2017-01-16T04:25:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert194w](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/robert194w/32/34068_2.png) [@robert194w](https://forum.freecodecamp.org/u/robert194w)\
**Post date:** [January 16, 2017, 4:25am UTC](https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055/1 "2017-01-16T04:25:43Z")

</div>

I am a newbie  
I am sure you will recognize the mess below!  
The instructions are to convert C to F degrees.  
Problem is there was no lesson about using function variables  
…or how to use the apparent variable definition in your code to create calculations

I cannot find this anywhere I look!  
Anybody throw me rope?

* * *

```auto
function convertToF(celsius) {
  var fahrenheit;
  // Only change code below this line

 var celcius = ();??????????
  fahrenheit = celcius *(9/5)+32; 
  
  
  
  // Only change code above this line
  return fahrenheit;
}
// Change the inputs below to test your code
convertToF(10
          );

```

---

<div class="post-metadata">

**Author:** ![fidelscodes](https://avatars.discourse-cdn.com/v4/letter/f/6de8d8/32.png) [@fidelscodes](https://forum.freecodecamp.org/u/fidelscodes)\
**Post date:** [January 16, 2017, 4:38am UTC](https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055/2 "2017-01-16T04:38:58Z")

</div>

You don’t have to create a `celsius` variable. It is being passed in as a parameter to the function. This means you have access to it while inside the function brackets.

Your code should work if you remove the line with all the question marks. Then, when the following line runs:

```auto
fahrenheit = celsius * (9/5) + 32;

```

`celsius` will be equal to the value that’s passed in when invoking (calling) the function.

In the case of that code example, if you look at the last line, `convertToF(10)` means celsius will have a value of 10 inside the scope of the function.

For further help understanding functions, consider going through this part of the Codecademy JS track:

> **[Functions in JavaScript](https://www.codecademy.com/courses/functions-in-javascript-2-0/0/1)**
>
> A guide through the basics of creating and using functions in JavaScript.

---

<div class="post-metadata">

**Author:** ![PortableStick](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/portablestick/32/65591_2.png) [@PortableStick](https://forum.freecodecamp.org/u/PortableStick)\
**Post date:** [January 16, 2017, 4:39am UTC](https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055/3 "2017-01-16T04:39:40Z")

</div>

I cleaned up your code.  
You need to use triple backticks to post code to the forum.  
See [this post for details](http://forum.freecodecamp.com/t/forum-code-formatting/25574).

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 5:10pm UTC](https://forum.freecodecamp.org/t/floundering-with-javascript-task-help-im-drowning/77055/4 "2021-01-16T17:10:27Z")

</div>

Closed on January 16, 2021, 5:10pm UTC


