# I need some Java Script help

**URL:** <https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061>\
**Category:** General\
**Created:** [August 29, 2016, 5:21am UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061 "2016-08-29T05:21:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![berg25](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@berg25](https://forum.freecodecamp.org/u/berg25)\
**Post date:** [August 29, 2016, 5:21am UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061/1 "2016-08-29T05:21:42Z")

</div>

This below is my problem i am having it is split into three sections what am i doing wrong.

//Create a function called myName that returns your name

function myName(){  
return prompt(‘Brendan’)

//Now save the function definition of myName into a new variable called newMyName

var newMyName=(‘myName’)

//Now alert the result of invoking newMyName

alert(‘newMyName’)  
}

---

<div class="post-metadata">

**Author:** ![hisener](https://avatars.discourse-cdn.com/v4/letter/h/2acd7d/32.png) [@hisener](https://forum.freecodecamp.org/u/hisener)\
**Post date:** [August 29, 2016, 5:38am UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061/2 "2016-08-29T05:38:36Z")

</div>

Please take a look [http://www.w3schools.com/jsref/met\_win\_prompt.asp](http://www.w3schools.com/jsref/met_win_prompt.asp)

And then try to solve the problem. If you can’t, [https://jsfiddle.net/hisener/8737pn5j/](https://jsfiddle.net/hisener/8737pn5j/)

---

<div class="post-metadata">

**Author:** ![alphaoliveira](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/alphaoliveira/32/14824_2.png) [@alphaoliveira](https://forum.freecodecamp.org/u/alphaoliveira)\
**Post date:** [August 29, 2016, 6:21am UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061/3 "2016-08-29T06:21:38Z")

</div>

Check if the brackets match. Use the Developer tools of your browser to execute line by line when it is possible or some equivalent action. Try to learn exactly how things work --in this case, the prompt method, reading the [documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt). Try the **ww3schools** as advised in the former answer.

---

<div class="post-metadata">

**Author:** ![slocodemonkey](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/slocodemonkey/32/15110_2.png) [@slocodemonkey](https://forum.freecodecamp.org/u/slocodemonkey)\
**Post date:** [August 29, 2016, 6:01pm UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061/4 "2016-08-29T18:01:55Z")

</div>

Remember, if you enclose something in quotation marks (single or double) it becomes a string.

Take the following example:

```
var myVar = "pizza";
 console.log(myVar);// logs "pizza"
 console.log('myVar'); // logs 'myVar'. Not what I want!

```

Same with functions that return a string:

```
function myFunc(){
 return "foo";
}

console.log(myFunc()); // logs "foo"
console.log("myFunc()"); // logs "MyFunc()" Not what I want!

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [January 16, 2021, 5:29am UTC](https://forum.freecodecamp.org/t/i-need-some-java-script-help/32061/5 "2021-01-16T05:29:12Z")

</div>


