Why is this not working sorry i just started codeing int score = 100; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why is this not working sorry i just started codeing int score = 100;

This question is already answered

26th Jun 2021, 2:05 AM
Isaiah Alexis
Isaiah Alexis - avatar
7 Answers
+ 6
1. Is the language actually Javascript? Asking, because many get Java and Javascript confused thinking they are the same or are related. 2. If Javascript then no type is needed prior to the variable name, and it should be written usually in 1 of the following 3 ways, depending on your scope needs. score = 100; var score = 100; let score = 100; If you're not sure about the scope I recommend you 1st try using let then var. I don't recommend that you write code using variables with neither let or var as they result in global scope. 3. If Java or another language is what you intended, or this doesn't seem to resolve your issue,, then you'll need to supply more than just a single statement of your code and instead a minimal example.
26th Jun 2021, 2:40 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Unless you show your code we can't help you. So plz show your attempt
26th Jun 2021, 2:15 AM
Aysha
Aysha - avatar
+ 2
Thx
26th Jun 2021, 2:42 AM
Isaiah Alexis
Isaiah Alexis - avatar
+ 2
In javascript you dont use int you can only use var, let and const
26th Jun 2021, 1:39 PM
Predator
Predator - avatar
+ 1
My attempt is int score = 100;
26th Jun 2021, 2:16 AM
Isaiah Alexis
Isaiah Alexis - avatar
+ 1
Oh
26th Jun 2021, 3:08 PM
Isaiah Alexis
Isaiah Alexis - avatar
0
You need to write Var instead of int Var score = 100;
26th Jun 2021, 2:19 AM
Aysha
Aysha - avatar