Tell us what’s happening:
how can i declare and assign the same variable to a number or string
Your code so far
// Variable declarations
var StUDLYCAPVAR;
var properCamelCase = "tITLEcASEoVER";
var TitleCaseOver;
// Variable assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
.
Challenge: Understanding Case Sensitivity in Variables
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Hello! Welcome to the community !
You have to edit the code so the variable names use camelCase
. You need to edit them in the // Variable declarations
and // Variable assignments
sections.
please how i have tried that with the assignments and declarations
Do you mean to say how to re-assign string or number to a variable like :
var aVariable = one value;
aVariable = another value;
?
Let’s assume we have this code:
// Variable declaration
var UPPERCASE = "all uppercase";
var camelCase = 1;
var PartiallyCORrect = "almost right";
// Variable assignments
UPPERCase = 30; // This doesn't exist
camelCASE = "this is wrong";
partiallyCORRECT = "this doesn't exist either";
The lesson is asking you to correct the variable names, using camel case. This means that you need to modify it like this:
// Variable declaration
var upperCase = "all uppercase";
var camelCase = 1;
var partiallyCorrect = "almost right";
// Variable assignments
upperCase = 30; // This doesn't exist
camelCase = "this is wrong";
partiallyCorrect = "this doesn't exist either";
Does it help?
let me try maybe it will work
no not that is assigning and declaring it with another variable