gsgasil.blogg.se

Javascript basic data types
Javascript basic data types









javascript basic data types
  1. #Javascript basic data types code
  2. #Javascript basic data types password

Numbers can be positive, negative whole numbers, or even be numbers with decimals. Let's dive into how numbers work in JavaScript. Numbers are a core part of programming because we are always counting or calculating something.īut don't worry, I'm not about to hit you with some advanced calculus or statistics here. Strings are very versatile and have a lot of great use cases like storing user input.Īs you continue on your coding journey, you will find even more ways to use strings. Now this is a very secure password, but I don't recommend using it for any of your sites because, well, it's public now.

#Javascript basic data types password

Document const palindrome = "tacocat" const occupation = "Hand Model" const password = My absolute favorite palindrome is "tacocat". That's a word that's the same backwards and forwards.

javascript basic data types

I'll be using double quotes for our examples.įirst, we'll create a new variable with a string data type called palindrome. So you choose the one that you like the most. There are no types of performance boost or any other advantages. The only catch is that you have to use a single quote, double quote or backticks to surround the variable value.īut for now, you can use single quotes or double quotes. Strings are letters, numbers, emojis, and any type of character you see on the keyboard. Specifically, we're going to spend some time focusing on strings, numbers, boolean and undefined/null.įirst up, let's talk about everyone's favorite: strings. We're going to cover objects in another chapter. These are built into the language, but they're not objects. And when I say data types, JavaScript has the concept of primitive data types. JavaScript has many different data types. And I've already set up a template to work with.

#Javascript basic data types code

I've created a file called 02-data-types.html in our code folder.

javascript basic data types

Well, you're in luck because that's exactly what I'm going to tell you right now. Before we can go forward with the rest of the course, you probably are wondering which types of data variables can store.











Javascript basic data types