Javascript help


#1

I have a bit of a problem on one of the codecademy javascript courses. Well, the "Learn JS" part that is. It tells me to create another console.log entry and divide 65 by 240. I type in the right words and numbers and symbols and closers and everything, but then it gives me an x for something the instructions are clearly telling me to create yet it doesn't work. I tried spacing the numbers away from the division sign (/) and i tried many times not spacing anything at all. Nothing is working. And I can't move on without getting this one right. I'm in a pickle :confused: by the way, admins: if this post is in the wrong place feel free to relocate it to where it should be, because i don't know where else it would go. Thank you much for admining great!


#2

Can you please copy and paste your code so we can have a look? Also the exercise URL? Thanks in advance.


#3

console.log('3.5+22');
console.log('48');
console.log('65/240');

This above is what I'm trying to complete. The link is below this sentence.

https://www.codecademy.com/courses/learn-javascript/lessons/introduction-to-javascript/exercises/math-operators?action=lesson_resume

I don't know if this is a bug or if I'm just missing something that is glaringly obvious. My JS skills are squat :stuck_out_tongue:


#4

When you put quotation marks around something it turns it into a string.

console.log('3.5+22'); 
console.log('48');
console.log('65/240');

Simply remove the quotation marks to make your code like this.

console.log(3.5 + 22); 
console.log(48);
console.log(65/240);

#5

does JS not use as many quotations and double quotations as other languages?


#6

Not sure what you mean. Quotes will give you strings, which you don't want around numbers.

If you need to make a calculation, such as 1 + 1, don't use quotes. If you want to store, say, a phone number, you might wanna use quotes.


#8

guys, I have another problem, I work in Sublime Text 3 in parallel and it gives me an error at the console.log() code. Please help


#9

Can you please copy and paste your code so we can have a look? Also the
exercise URL? Thanks in advance.


#11

It happened to me too and need help PLEASE


#12

A post was split to a new topic: Get an error when placing the name of the book