Friday, March 24, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

Learn Fundamentals of JavaScript : Number Variable, Multiple Variables, Booleans, Strings

learningcode_x1mckf by learningcode_x1mckf
January 7, 2023
in JavaScript
0
Learn Fundamentals of JavaScript : Number Variable, Multiple Variables, Booleans, Strings
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


Day 1 of #100DaysOfCode

After exams and plenty of procrastination, I lastly resumed my #100DaysOfCode journey with JavaScript. Right this moment is the first day of my journey and discovered some fundamental ideas of JavaScript.

You might also like

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

Select data value from grandparent div? – JavaScript – SitePoint

How to Handle Errors in JavaScript – Programming – MUO – MakeUseOf

I’m going to jot down about my learnings in an defined approach by my blogs and socials. If you wish to be part of me on the training journey, be certain to comply with my blogs and social and share yours too. Let’s study collectively!🫱🏼‍🫲🏼

Introduction to JavaScript

The inspiration of latest on-line apps is JavaScript. Though which will sound pretentious or flowery, it is usually the fact. JavaScript powers the up to date internet, your up to date servers, and even the event environments on our computer systems. Whether or not it’s internet 2.0 or internet 3.0, JavaScript is used in all places.

Quantity Variable

A JavaScript variable is nothing greater than a reputation for a storage space. In JavaScript, there are two different types of variables: native variables and international variables. When declaring a JavaScript variable, there are a number of tips (also called identifiers).

  • The title should start with an alphabetical letter (from A to Z), an underscore (_), or a greenback signal ($).
  • The primary letter might be adopted by any quantity from 0 to 9, corresponding to the worth 1.
  • JavaScript variables are case-sensitive; as an illustration, the variables x and X are distinct.
  • JavaScript variables are written in lowerCamelCase. for instance const isLoggedIn = true;
  • JavaScript cares about variables in a single phrase (not separated by area).

We retailer values in one thing referred to as a variable.

const a = 5

Within the above code, a is the variable. Quantity 5 is the worth to be saved in a and const is a key phrase used to declare a as a relentless worth in JavaScript.

A number of Variables

JavaScript packages run line by line, the road const a = 5 is known as an announcement. In JavaScript, statements ought to finish with ; (semi-colon). In some circumstances, JavaScript mechanically inserts semi-colons in an announcement. The perfect follow is to insert ; at each assertion finish.

We will create one other variable to retailer the worth of the earlier variable.

const a = 5;

const b = a;

Each a and b will retailer the worth 5.

Booleans

A JavaScript Boolean represents certainly one of two values: true or false.

const loggedIn = false;

If a person is logged within the above line, the false indicated that they aren’t.

We will additionally retailer boolean values inside variables. If we’ve got to retailer true in a single variable and false in one other variable, then:

cont a = false;

const b = true;

Quotes

Each single ' ' and double " " quotes can be utilized when declaring JavaScript strings.

Right here, we used double quotes so we may use a single quote contained in the message:

const message = "Whats up, hope you might be doing tremendous!" ;

If we would have liked to make use of double quotes:

const message = 'Then he stated, "Hey, are you coming dwelling?"';

If we would have liked to make use of a double quote inside double quote string, we are able to use a backslash as an escape character:

const message = "That is double-quote " inside double-quotes";

Strings

Strings in JavaScript are used to retailer and modify textual content. A string in JavaScript is zero or extra characters enclosed in quotes.

Strings are nothing however a bunch of characters (a, b, c) put collectively.

In JavaScript, there are 3 ways to outline a string. first two of them are:

  • const a = "Whats up!";

  • Right here, myName and anotherName makes use of two various kinds of quotes, single and double. We will use both one or inside one another.

    const myName = 'Anand';

    const anotherName = "Vishal";

Now have a look at the third technique to declare strings:

const helloMessage = `Whats up $myName, my title is $anothername!`;

Right here, helloMessage variable makes use of backticks ` . With backticks, we are able to add values contained in the strings. The $variable is about this. Within the above line of code, we’re taking worth from myName and anotherName and putting them into strings. The variable helloMessage now comprises "Whats up Anand, my title is Vishal!"

Conclusion

Ending with an additional little bit of details about JavaScript…

JavaScript additionally makes use of higher snake case typically like const SERVER_KEY_VALUE = "abcdefg"; This casing is usually reserved for atmosphere variables or values which might be wanted to be decided earlier than code executions. Like, in case you have some secret key that you just wish to retailer on the server however not on the native machine, then You may preserve that variable tucked away on the server in an atmosphere variable that may require permissions to entry or change. These are the sorts of variables we’ll typically see with this casing.

Right this moment I discovered about Quantity variables, a number of variables, booleans, quotes and strings in JavaScript.

If You ❤️ My Content material! Join Me on Twitter or Helps Me By Buying Me A Coffee☕


Additionally Printed Here

L O A D I N G
. . . feedback & extra!





Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

Toolkit Allows JavaScript Devs to Program Embedded Devices – The New Stack

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Toolkit Allows JavaScript Devs to Program Embedded Devices  The New Stack Source link

Read more

Select data value from grandparent div? – JavaScript – SitePoint

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Select data value from grandparent div? - JavaScript  SitePoint Source link

Read more

How to Handle Errors in JavaScript – Programming – MUO – MakeUseOf

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

How to Handle Errors in JavaScript - Programming  MUO - MakeUseOf Source link

Read more

How to Use the Javascript Slice Method – hackernoon.com

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

How to Use the Javascript Slice Method  hackernoon.com Source link

Read more

Clean Code in JavaScript – SitePoint

by learningcode_x1mckf
March 23, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Clean Code in JavaScript  SitePoint Source link

Read more
Next Post
Oracle aligns GraalVM development with Java development

Oracle aligns GraalVM development with Java development

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

Encoding and decoding data using the Hummingbird framework

Encoding and decoding data using the Hummingbird framework

March 22, 2023
Should Developers Choose C++ Over Python for Machine Learning?

Should Developers Choose C++ Over Python for Machine Learning?

January 21, 2023
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Would this be a solution? – JavaScript – SitePoint

February 19, 2023

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • Java Developer Survey Reveals Increased Need for Java … – PR Newswire
  • What You Should Definitely Pay Attention to When Hiring Java Developers – Modern Diplomacy
  • Java Web Frameworks Software Market Research Report 2023 … – Los Alamos Monitor

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?