
Join the Conversation!
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
Learning Objective: Differentiate between typed and typed languages in terms of data types.
In JavaScript, you can change the data type of a variable at any time. For example, you can change a variable from a number to a string:
let age = 25;
console.log(age); // 25
age = "25";
console.log(age); // 25
In this lesson, you learned the difference between statically typed and dynamically typed languages. Now, let’s dive into Operators in JavaScript!
"Please login to view comments"
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
By logging in, you'll unlock full access to this and other free tutorials on JSM Pro.
Why? Logging in lets us personalize your learning experience, track your progress, and keep you in the loop with new workshops, coding tips, and platform updates.
You'll also be the first to know about upcoming launches, events, and exclusive discounts.
No spam—just helpful content to level up your skills.
If that sounds fair, go ahead and log in to continue →
Enter your name and email to get instant access
##Looks like we found a thief monkey By the way, I liked the trick how you reached till here. You have a good sense of humor. You will improve a lot if you join our course with this passion.
var
(function-scoped, outdated)let
(block-scoped, modern and recommended)const
(block-scoped, cannot be reassigned)_
, or $
let let = 5;
is invalid)myVar
and myvar
are different)string
, number
, boolean
, null
, undefined
, bigint
, symbol
Objects
, Arrays
, Functions
Subscribing gives you access to a brief, insightful summary of each lecture to stay on track.
00:00:00 Now that you know about all the different data types we can use within JavaScript, I want to talk about a concept known as statically versus dynamically
00:00:08 typed languages.
00:00:10 Statically typed languages are those in which the type of each variable and expression is determined at compile time.
00:00:18 So once a variable is assigned a specific data type, it cannot store values of other data types.
00:00:25 This happens in C, C++, or Java.
00:00:29 But dynamically typed languages, like JavaScript for examples, are those in which the type of each variable is determined at runtime,
00:00:39 which means that variables can store different data types at different times.
00:00:44 So in JavaScript, you can change the data type of a variable at any time.
00:00:48 For example, if you first declare age as a number of 25, and then you decide to change it for whatever reason to a string of 25, you can see that we have
00:00:59 no error.
00:00:59 First, age is a number, and then age is a string.
00:01:03 So what does this mean for you?
00:01:05 Well, it means that JavaScript is more flexible than some other programming languages, allowing you to change data types of variables at different points
00:01:13 in time.
00:01:14 But this is not necessarily a good thing, because you might change the type of a variable unknowingly, and therefore get a lot of errors.
00:01:22 So even though you can do this, it's typically not recommended to change the type of a variable.
00:01:28 If you have an age defined as number, keep it as such.
00:01:31 So now that you know everything about variables and data types in JavaScript, you're ready to learn how to do something with them.
00:01:38 So I want to congratulate you for completing the first module in this JavaScript course.
00:01:43 And now we're ready to move over to the second module called operators in JavaScript.