Posts

Complete JSON tutorial: learn JSON quickly

Image
  Complete JSON t utorial : learn JSON quickly JavaScript Object Notation, or the more commonly known abbreviation JSON, is widely used in various applications. Its purpose is to simplify communication, the most common is communication between the browser and the server. Although there are, the reverse is also true. In your development process, you will inevitably encounter JSON. This article hopes to give you an understanding of how to use it. A Basic Introduction When you dive into JSON it is very easy to use, it is just plain text constructed in a certain way. If you've never seen it with your own eyes before, now is a good time to show a small example. This is what it looks like-- { "SiteName": "CodeWall", "ArticleName": "JSON Tutorials", "Revision": 1 } JSON Data Types: JavaScript's object notation can handle almost all types of data you might need. This is of course a very powerful tool, and being able to handle

The Complete Guide to Reacting for Beginners in 2021

  The Complete Guide to Reacting for Beginners in 2021 Welcome to the React Beginner's Guide. It aims to teach you all the React basics you need to know to start building React applications in 2021.   I created this resource to provide you with the most comprehensive and beginner-friendly way to learn React from scratch.   Finally, you will have an in-depth understanding of a large number of basic React concepts, including:   The reason, content, and method of React   How to easily create a React application   JSX and basic syntax   JSX elements   Components and attachments   Events in React   states and State Management   Basics of React Hooks    React Basics What exactly is    React?   React is officially defined as "a JavaScript library for creating user interfaces", but what does this mean?   React is a library written in JavaScript. We write JavaScript code to create great applications that run on the web.   What do I need to know to learn React?   In other words, do

Map ad Set in JavaScript

Image
  Map and Set We've learned about the following complicated data structures up to this point: Keyed collections are stored in objects. For storing ordered collections, arrays are employed. But in real life, that isn't enough. Map Like an Object, a Map is a collection of keyed data objects. The primary distinction is that Map accepts any type of key. The following are examples of methods and properties: new Map() is a function that generates a map. The value is stored by the key in map.set(key, value). map. get(key) – returns the value associated with the key, or null if the key does not exist on the map. If the key exists, map.has(key) returns true; otherwise, it returns false. map.delete(key) – deletes the value associated with the key. map.clear() - clears the map of all items. The current element count is returned by map.size. One of the most noticeable and essential Map features is the use of objects as keys. The same cannot be said for Object . It's acceptable to

Array Methods in JavaScript for adding and removing items from the beginning and end of a list

  Methods that use arrays Arrays have a plethora of methods. They are divided into groups in this chapter to make things easier. Items can be added or removed. We already have methods for adding and removing items from the beginning and end of a list: arr.push(...items) – pushes things to the end of the list. arr.pop() – pulls a single item from the end of the array. arr.shift() – extracts a single item from the start. arr.unshift(...things) – inserts items at the start. const arr = ['🍅', '🍄', '🥦', '🥒', '🌽', '🥕', '🥑']; Array Methods in JavaScript 1. map( ) This method returns a new array with the results of running a function on each member of the array. const newArr = numbers.map; const numbers = [4, 9, 16, 25]; (Math.sqrt) 2. filter( ) This method produces a new array containing only elements that satisfy the criteria in the function. This function is used to sort the items of an array in either ascending or descending or