Lia Sue Kim

Lia Sue Kim

1640541646

JavaScript is Sensitive - Var VS Let #shorts

https://youtu.be/JsovKbc97kc

JavaScript var VS let keywords

One of the problems with the var keyword is that you can use the same variable name more than once.

So what ? you may ask.

Well, if you use the same variable name more than once, with different values.

You are actually overwriting the variable declaration & value each time.

This behavior doesn’t throw/give an error, so searching for and fixing your bugs becomes more difficult in large projects.

Look at this example:

// #1 Here the value is "Lia Sue Kim"
var myName = "Lia Sue Kim"; 
// #2 Here is "Jane Doe"
var myName = "Jane Doe";

Using let instead of var keyword in JavaScript

If you replace var with the let keyword in the code above, you’ll get a syntax error:

Uncaught SyntaxError: redeclaration of let myName

It means with let & const keywords you can’t declare/create a variable with the same name twice. In other words you can’t recreate/redeclare a variable.

So let’s use the let keyword to replace the var for good.

let dogName = "Tom";
let dogSound = "Woof!"

That’s it for this one and I’ll see you in the next one. Sorry if you are a cat person. I love all living things, forms.

Follow me for more programming tips and tricks.

I try my best to break programming concepts into smaller chunks, so you can easily digest.

Don’t forget to join my Youtube channel

#javascript #JavaScript #programming #coding #web-development #software-development 

 

What is GEEK

Buddha Community

JavaScript is Sensitive - Var VS Let #shorts
Coy  Roberts

Coy Roberts

1601976360

Javascript let vs var: The Difference and Comparison

Javascript let, and var are both used for variable declaration. Before the ES6, JavaScript had only two types of scope:

  1. Global Scope
  2. Function Scope

Global Scope

Variables that are declared Globally (outside any function) have Global Scope.

var netflixFilm = "enola holms";

// code here can use netflixFilm

function detective() {
  // code here can also use netflixFilm
}

In this example, the variable is defined outside the function. So it is in the global scope.

You can access global variables anywhere in JavaScript programs.

#javascript #javascript let #javascript let vs var

Jennie  Hane

Jennie Hane

1626051600

Var vs Let vs Const: JavaScript complete course in 2021 in Hindi #6

Var vs Let vs Const: JavaScript complete course in 2021 in Hindi 🔥🔥🔥 #6
Support this channel: https://www.youtube.com/channel/UCo9xTRmg1SqQ5JSsA2fAgJw/join

In this video, We will have a look which keyword to use when creating a variable.

In this series, we will be learning the JavaScript programming language.
This course will be for absolute beginners as well as advanced users.
This is series has multiple parts which are depending on the previous video session.

⭐ I’ve started using Kite and I love it!
https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=codersgyan&utm_content=description-only
Javascript mini-projects:
https://www.youtube.com/watch?v=KlLdNSvmoKI&list=PLXQpH_kZIxTVeSYQXLtpvMBCirxKCxqZz
NodeJs crash course: https://youtu.be/wdBCoRMMxto
Express Js crash course: https://youtu.be/46Mjvdv_UUM
Realtime pizza app using Node Js: https://www.youtube.com/playlist?list=PLXQpH_kZIxTVRmXQN9J0Az76te5mAreLV
Flexbox: https://youtu.be/7WE_K7NDL0s

You may connect with me:
Facebook - ✅ https://www.facebook.com/codersgyan
Discord - ✅ https://discord.gg/WPfWD3B
Telegram - ✅ https://t.me/joinchat/AAAAAFbBD_inny1ksCzOvA
Instagram - ✅ https://www.instagram.com/codersgyan
Twitter - ✅ https://twitter.com/CodersGyan

You may support this channel by becoming a patron :)
https://www.patreon.com/codersgyan

#javascript #variables #let #const #var #codersgyan #happycoding #webdevelopment

#javascript #var vs let vs const #webdevelopment

Lia Sue Kim

Lia Sue Kim

1640541646

JavaScript is Sensitive - Var VS Let #shorts

https://youtu.be/JsovKbc97kc

JavaScript var VS let keywords

One of the problems with the var keyword is that you can use the same variable name more than once.

So what ? you may ask.

Well, if you use the same variable name more than once, with different values.

You are actually overwriting the variable declaration & value each time.

This behavior doesn’t throw/give an error, so searching for and fixing your bugs becomes more difficult in large projects.

Look at this example:

// #1 Here the value is "Lia Sue Kim"
var myName = "Lia Sue Kim"; 
// #2 Here is "Jane Doe"
var myName = "Jane Doe";

Using let instead of var keyword in JavaScript

If you replace var with the let keyword in the code above, you’ll get a syntax error:

Uncaught SyntaxError: redeclaration of let myName

It means with let & const keywords you can’t declare/create a variable with the same name twice. In other words you can’t recreate/redeclare a variable.

So let’s use the let keyword to replace the var for good.

let dogName = "Tom";
let dogSound = "Woof!"

That’s it for this one and I’ll see you in the next one. Sorry if you are a cat person. I love all living things, forms.

Follow me for more programming tips and tricks.

I try my best to break programming concepts into smaller chunks, so you can easily digest.

Don’t forget to join my Youtube channel

#javascript #JavaScript #programming #coding #web-development #software-development 

 

JavaScript Var, Let, and Const - 8

To declare a variable in JavaScript either var, let or const is used.
We will distinguish between the three with the following features:

  • Block scope
  • Update and redeclaration
  • Hoisting
  • Undefined

Official Website: https://techstackmedia.com

Watch the entire JavaScript Series, including upcoming JavaScipt videos on YouTube: https://www.youtube.com/playlist?list=PLJGKeg3N9Z_Rgxf1Und7Q0u0cSre6kjif

Check it out on the article: https://techstack.hashnode.dev/javascript-var-let-and-const

Become a patron to learn more: https://www.patreon.com/techstackmedia

Next: https://techstack.hashnode.dev/javascript-data-types

Techstack Media is in partnership with Skillshare: http://bit.ly/tsm-skillshare
Learn anything and get the required skill you need to kickstart a long-lasting career.

Website Request: bello@techstackmedia.com

Social Media:
✅ Facebook: https://facebook.com/techstackmedia
✅ Twitter: https://twitter.com/techstackmedia
✅ Instagram: https://instagram.com/techstackmedia
✅ LinkedIn: https://linkedin.com/in/techstackmedia

#javascriptdatatypes #javascipthoisting #javascriptvariable #techstackmedia #webdev #DEVCommunity #100DaysOfCode #opensource #codenewbies #womenwhocode #html #webdevelopment

#javascript #javascript var #let #const

Samanta  Moore

Samanta Moore

1624959720

Java Vs. JavaScript: Know the Difference

What a mess it could be to share the same name — especially if you are a programming language. Even if you are already over 20 years old, IT newbies periodically confuse you with your namesake. This happens all the time with Java and JavaScript, although they are not related at all! As someone on the internet said. They correlate in much the same way as a car and a carpet.

Why do these two languages have such similar names? How do they differ from each other, and what else do they have in common? This article will provide the answers to these questions.

In the Beginning, It Was Java

The Same Year, A Little Bit Later: Meet JavaScript!

Technical Differences Between Java and JavaScript

What Can You Build in Java and JavaScript?

#java #javascript #javascript-development #java-development #learn-to-code-java #learn-javascript #programming #java-vs-javascript