Java Script Input/Output Lesson

Hi,

I’m trying to follow along but I’m not getting the output like Zsoltan once I enter he below code. I was wondering if an experienced member/admin could look and help identify why?

const ticker = prompt ('Enter your crypto ticker: ');
const amount = +prompt ('Enter the amount you bought: ');

console.log(`You just bought ${amount}${ticker}`);
1 Like

Hey @Mitul, hope you are well.

Could you please share your code in the following way so i can help you review it? :nerd_face:
https://academy.moralis.io/lessons/how-to-post-code-in-the-forum

Carlos Z

Hey @thecil. I’m good thanks. I’ve re entered the code in the proper format. Can you please advise on where I’m going wrong?

Thanks

1 Like

Yes, sorry for the delay.

The code you provided does not have any error on it, it does work as expeceted :nerd_face:


What is exactly the issue you have?

Carlos Z

Thanks. But I don’t seem to get any output? Below is the screen grab:

I am having the same issue! can anyone help us out?

1 Like

@S_dot24 hey it does work your just doing it in the wrong order. once you fill in the name for th eprompt it will return undefined. But if you then write console.log(person) and hit enter it will print the name

Thank you for your response @mcgrane5 ! Here is my issue.

1 Like

yes no execute the cnsole.log command again

1 Like

Im sorry if i am acting slow but this is what i got.! @mcgrane5

1 Like

ok do this. run the following

const x = prompt("enter a number")

then after this run

console.log(x)

I get the prompt, I enter my number but it still says undefined.

yes when you get the prompt it will be undefined thats why u neesd to run console.log(x) as a seperate command after u enter the prompt the first time

Here is what i got… I appreciate you helping me out!!!

1 Like

there must be something your not doing right i dont know how else to explain. look i wouldnt get caught up on this you will litreally never ever be using the console in the browser like this anyway and the same is true for the prompt command. im not sure how else to explain you mjust need to run the commands seperately and it will work

Click “ Default levels ” right next to filter and do make sure that " Info " is checked.

Please see screenshot:

2 Likes

niceone for that @Maki i was unaware of this. @S_dot24 should work for u now

1 Like

@Maki @mcgrane5 Thank you it works now! Thank you for being patient!

1 Like