+ 8
What is Assignment Operators in JavaScript and what is work and what it's used in JavaScript?
17 Respostas
+ 6
in simple words, the assignment operator works like this: when declaring a variable (using special words [var, let, or const]), space is reserved for data in the computer's memory area. but there is no data yet. this can be compared to a room and an empty box. a room is all the computer's memory, and a box is your variable. as long as there is no variable (you haven't declared it), the room is empty. and now comes the crucial moment... you have declared a variable! [let userName;] (a box was brought into the room). but your variable doesn't matter yet. it is empty (the box is empty, but"userName"is written on top of it). but from now on, the computer sees your variable. he can now manipulate her. if you try to output its value at this point, javascript will give you the answer: "undefined". to assign a value to a variable, use the "= " assignment operator. userName = "Johnny".you put the text (string value "Johnny")in the box (pc memory).
+ 8
The assignment operator is normally known as the equal sign (=).
It is for Assigning a value to a variable eg
var name="name";
Happy coding đ Keep coding
+ 6
Thank you đ
+ 5
Is it your homework?
+ 4
Just follow your course tutorial and keep practicing. Watch youtube vids of what you want about Js. Do google research.
+ 4
Thank you so much for this detail . Now I understand what Assignment Operators are doing.đ
+ 3
No, I am learning JavaScript and am confused about assignment operators. I don't understand what's it works and uses.
+ 3
And other operators uses?
+ 3
Recently I started a JavaScript course.
+ 3
maybe it was a bit confusing, but I tried to avoid đ
Successful coding!
+ 3
Thank you đ
+ 3
I'm confused about the part of the question which says "what is work?"
+ 2
Greetings! I dare say that you probably have not fully completed the JavaScript training course in this app. perhaps there you can find the answer to your question
+ 2
thank you, I've already seen it. isn't one assignment statement enough for you? do you need more???
+ 2
let userName;
console.log(userName); // undefined
userName = "Johnny";
console.log(userName) // Johnny
+ 1
for assigning a value to a variable(var, let, const)