Sign in

A passionate UI Engineer, Love Travelling and Photography
9 Array Methods Every JavaScript Developer Should Know

Why Array?

Objects allow you to store keyed collections of values.

But quite often we find that we need an ordered collection, where we have a 1st, a 2nd, a 3rd element and so on. For example, we need that to store a list of something: users, goods, HTML elements etc.

There exists a special data structure named , to store ordered collections.

Nowdays Array is a ❤️ of javascript if you work with API to communicate with backend.

Oops!!!! Forgive me for the adding basic info about array 😨

Lets get started! 🏃

1. includes()


JavaScript is a programming language used both on the client-side and server-side that allows you to make web pages interactive.

Pros

  • Popularity. JavaScript is used everywhere on the web.
  • Gives the ability to create rich interfaces.
  • Easy to learn and implement.

Cons

  • Browser Support. JavaScript is sometimes interpreted differently by different browsers. Difficult to write cross-browser code.
  • Code is always visible to everyone on the client side.

Advise before start

Learn how the web works and the Basic HTML and CSS.

Pillars of JavaScript

I split into seven sections

  1. Fundamentals
  2. Advance Level
  3. Web Platform
  4. Tools
  5. Frameworks and Libraries
  6. Testing
  7. Security

1. Fundamentals

This is the most important section, It might…


We often use an array in every project for data manipulation.

Let’s play with the CRUD operation.

Create

Create an array. It will contain programming languages.

Read

We have a lot of options to read it.

Print the entire array in a referenced way.

Print the first item by using

Print all items by using for loop

The above snippet will print all items of the array individually.

Print all items by using

Cleaner…


Deploy a React App to GitHub Pages

Let's deploy react application on GitHub by using GitHub Pages.

Prerequisites

You need to have Node, yarn, and npm installed on your machine. To check if they are installed, open up a terminal window and type the following:

If these commands print out a version number in the terminal, you are good to go. If not, you need to go ahead and install what is missing.

Am assuming you already have a Github account. if not create here

Create a project

To create a project, you need to type the following in the terminal:


Let’s start with an issue that is listed on many platforms but not with the exact solution.

  • localStorage won’t update values 🤔
  • local storage in react is not storing the updated value 😐
  • localStorage not working properly in ReactJS 😑
  • localStorage value doesn’t get updated automatically 😫

This is a very common issue when you need to store data in the browser by using any methods sessionStorage or localStorage with React Hooks.

let's get rid out of it. 😎

Scenario

I have a language that I change on the selection of dropdown and store on the browser.


Github introduced a new feature, Where you can add personal information about yourself in your bio, projects you’ve contributed to, or interests you have that other person may like to know about.

Do it in a minute

If you’re in hurry or already aware of the markdown. You can skip all the steps.

Just click on the link , copy all and paste it to your repo in your file.

and start editing with your own information. 😉

Or follow the steps

If you are new and want to explore then follow the steps

Let’s start with creating a new repo with the same username.

Step 1

in my case…


A person who can develop the entire application — Fullstack developer graph

Hi Folks,

Currently, most of the newcomers are planning to go for full-stack development.

What is a full-stack developer?


Object destructuring is a useful JavaScript feature to extract properties from objects and bind them to variables. What’s better, object destructuring can extract multiple properties in one statement, can access properties from nested objects, and can set a default value if the property doesn’t exist.

Normally, we access objects with the key. Nothing new :)

Let’s have quick look at the example below:

We have a user object which contains user info (name, city, type). …


These packages will save your time.

Dotenv

Dotenv is a zero-dependency module that loads environment variables from a file into

Bcrypt

A library to help you hash passwords.

Bcrypt package

UUID

UUID is a unique random ids values generator. It generates strong random values.

Axios

Axios is a Promise based HTTP client for the browser and node.js

Socket.io

Socket.io enables real-time, bi-directional communication between web clients and servers.

Moment

Moment.js is a date library for parsing, validating, manipulating
and formatting dates.

Lodash

Lodash is very useful when working with numbers, arrays, objects,
strings, etc.

Nodemon

Nodemon automatically restarts the node application when changes in
the directory is detected.

Thanks :)


1. Scopes 🤗

Scopes

The understanding scope will make your code stand out, reduce errors and help you make powerful design patterns with it

Local and Global

There are two kinds of scope — global scope and local scope

Variables defined inside a function are in local scope while variables defined outside of a function are in the global scope. Each function when invoked creates a new scope.

JavaScript has function scope: Each function creates a new scope.

Hidayt Rahman

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store