Day 1 of #30daysOfJs

ยท

3 min read

Hey friend ๐Ÿ‘‹, hope you're doing amazing in life.

Today I'm gonna share my learnings in JS ๐Ÿ™‚.

  • JavaScript is a lightweight, interpreted and Just-in-time compiled programming language with first-class functions.

  • It is mostly well-known scripting language for web pages, it supports object-oriented, declarative, imperative programming styles.

  • It is a dynamic and single-threaded language.

Requirements

You require very few things, believe me

  1. A computer/Laptop

  2. Internet

  3. Browser

  4. A Code editor

  5. Very importantly, motivation

Setup

Installation

You may not need it right now, but later on it is used

  1. Go to Node Js

  2. Download it according to your system.

  3. Then Install it.

Now to check if Node js is installed successfully, open Terminal or Command prompt and enter "node -v"

You may get a different version, but if it shows similar output then the installation is done.

Browser

Open Google Chrome.

Here we have a console where we can write small JS code, but remember we don't use this in developing applications.

Click the three dots in the top-right corner in the browser -> More tools -> Developer tools

Or else use shortcuts โœŒ

For Windows

  1. ctrl + shift + i

  2. ctrl + shift + j

  3. or simply, F12

For Mac

  1. command + shift + i

  2. command + shift + j

This will be the output

Writing code on the browser console

console.log() -> You can write anything inside it and it'll print it

You can write numbers, their arithmetic operations can also be done inside the brackets.

But, if you're writing a "String" meaning Text then you need to enclose them inside " " (inverted commas/double quotes) unless that is any name of a variable.

If the above statement confuses you then wait until we discuss Data Types and variables in our next blog.

The console also displays the errors occurred in JS code.

So, what is console ๐Ÿค”?

Console is one of the web APIs that has been provided to JS.

Now the console object which we are using provides access to the browser's debugging console.

There are several methods associated with it :

  • console.log() -> Outputs a message to the console

  • console.table() -> Outputs tabular data as a table

  • console.error() -> Outputs an error message to the console

  • console.warn() -> Outputs a warning message to the console

And there are a lot more commands for console. Check out : Console object methods

Installing VS code :

I'm using VScode because it has a lot of features that makes coding very simple ๐Ÿ™‚.

Download VS code from here

The next topics we will be doing in VS code itself.

Upcoming Topics :

  1. Ways of adding JS to a web page

  2. Comments in JS

  3. Data types

  4. Variables

  5. Strings, string concatenations, escape sequences,template literals

  6. String Methods

  7. Checking data type (typeof)

  8. Type casting.

Since this is my first day and also first time writing a blog, I'm ending it here ๐Ÿ˜….

Have a great day ahead ๐Ÿ™‚.

Don't forget to check out Day 2

Did you find this article valuable?

Support Mubashir Ahmed by becoming a sponsor. Any amount is appreciated!

ย