6/21/2023 0 Comments Basic data types in javascript![]() ![]() Arithmetic operations like Addition, Subtraction, Multiplication and division can be carried out on them. ![]() Operations are basically the way we use the data received.A data type is basically the way a programming language understands the data it receives telling it how the data is to be used.However, if you're interested I've written a blog post on functions. In my next article am going to talk about objects and everything you need to know about them. Now i don't know about you but that's enough data types for one day. What is the second type of data types in JavaScript? Well, that's everything you need to know about primitive data types. The AND operator written as & compares two values and returns true if both values on the left and right equate to true. JavaScript has three main logical operators. Logical Operators are used to compare two conditions. The ( = ) operator denotes "strictly equal to".The ( The ( > ) operator is used to denote "greater than"Ĭonsole.log(10 = ) operator denotes "greater than or equal to". ![]() These are the most common comparison operators. The result is either of the boolean values. There is a one difference between the equality operator and the strict equality operator which i'll get to in a second.Ĭomparison operators are used to compare two or more values. If you're interested in reading more about NaN and why it's not equal to itself, consider reading this article The issue with NaN not being equal to NaN is historical. Hence, the necessity of an isNaN function. ![]() Unlike all other possible values in JavaScript, it is not possible to rely on the equality operators (= and =) to determine whether a value is NaN or not, because both NaN = NaN and NaN = NaN evaluate to false. The point is we can write very huge numbers with JavaScript.Īll operations carried out on whole numbers are guaranteed to be precise and accurate.Įnter fullscreen mode Exit fullscreen mode Given 64 bits JavaScript can represent up to 18 quintillion numbers. JavaScript uses 64 bits to store a number. Values of the number type are numeric values written as usual numbers like 12, 67 and 85. Let's look at the primitive data types in JavaScript. I'll further explain this in the article. That means their values cannot be changed or mutated. Some primitive data types only accept a set value(s) and others accept certain type of values.Primitive data types are immutable. Let's explore both of them.Ī primitive data type can be understood as a basic data type in JavaScript. JavaScript has two main types of data types: primitive data types and objects. This is an in depth article so you might want to grab a pen and paper. In this article we are going to explore all the details of different data types in JavaScript and the operations that can be carried out on them. A data type tells the programming language how the value is meant to be used and the operations that can be carried out on it. In simple terms a data type is a type of value. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. ![]()
0 Comments
Leave a Reply. |