---
title: "Discussion on \"A Beginner's Guide to JavaScript Part  1\" | Hashnode"
description: "Discussion on \"A Beginner's Guide to JavaScript Part  1\". JavaScript is a popular programming language that is widely used to build web applications, mobile apps, and other software. It is a powerful language that can be used to create interactive, dynamic, and responsive applications, making it an essentia..."
url: "https://hashnode.com/posts/a-beginners-guide-to-javascript-part-1/63add767bb469d2badb6dc1a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A Beginner's Guide to JavaScript Part 1](https://vipindevelops.com/a-beginners-guide-to-javascript-part-1?utm_source=hashnode&utm_medium=feed)

JavaScript is a popular programming language that is widely used to build web applications, mobile apps, and other software. It is a powerful language that can be used to create interactive, dynamic, and responsive applications, making it an essentia...

Dec 29, 2022 · 8 min read · vipindevelops.com  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#developer](https://hashnode.com/tag/developer)

## Written by

[Vipin Chaudhary](https://hashnode.com/@VipinDevelops)

@VipinDevelops · Uttar Pradesh, India

  
[View profile](https://hashnode.com/@VipinDevelops)

Backend Developer

Hi there! My name is Vipin and I am an Undergraduate student pursuing a B.Tech. in Computer Science and Engineering. As a developer, I specialize in Back-end development and have a strong passion for creating and implementing efficient and scalable solutions. I am constantly learning and seeking new challenges to help me grow as a developer and to make a positive impact in my field. In my free time, I enjoy staying up to date with the latest technology trends and exploring new programming languages and frameworks. I also love to read books, watch anime, and explore new places. I am excited to continue my education and career in Computer Science and Engineering and to make a meaningful contribution to the field. Thank you for taking the time to learn more about me.

## Responses 1

Markdown supported · ⌘↵ to post

[Shivam Dixit](https://hashnode.com/@Shivamdixit)

[Dec 30, 2022](https://hashnode.com/posts/a-beginners-guide-to-javascript-part-1/63add767bb469d2badb6dc1a/comment/63ae438dbb6616386d7937f0)

What happen if we just assign value of any identifier in any function without declare it for sure it not gives error My Doubt : I think I will get consider as in Global Scope even it is in function but why when I accessing it in vscode it not runs function shiv (){ MyId = 45; var MyLoc = 67; … } Console.log(MyLoc) //Error ✅ Console.log(MyId) // Reference (Error) ❌❓❓

[Vipin Chaudhary](https://hashnode.com/@VipinDevelops)

[Dec 30, 2022](https://hashnode.com/posts/a-beginners-guide-to-javascript-part-1/63add767bb469d2badb6dc1a/comment/63ae438dbb6616386d7937f0#reply-63ae7798359f463d43abd18e)

In JavaScript, if you assign a value to an identifier (variable) without declaring it with var, let, or const, it will be treated as a global variable. This means that the variable will be created in the global scope and will be accessible from anywhere in your code.

However, if you are running your code in strict mode (by adding "use strict"; at the beginning of your script or function), you will get a reference error when you try to access an undeclared variable. Strict mode is a feature in JavaScript that makes it more strict about certain practices and helps you avoid mistakes in your code.

In the example you provided, if you are running your code in strict mode, you will get a reference error when you try to access MyId because it is not declared. However, if you are not running your code in strict mode, you will not get an error when you try to access MyId. Instead, the value of MyId will be logged to the console.

It is generally a good practice to always declare your variables with var, let, or const to avoid creating unintended global variables and to make your code more predictable and maintainable.

Let me know if you have any further questions or need more information.
