10 JavaScript snippets you can now use

There is no doubt that JavaScript is one of the most popular programming languages in Web development. Whether you use React, Vue or Angular, it's just JavaScript. An extensive and important ecosystem has been developed around JS, providing countless frameworks and libraries to help you develop applications faster. But sometimes it's best to st ...

Posted by Boerboel649 on Wed, 25 May 2022 21:22:40 +0300

In depth understanding of ArrayList and LinkedList, source code analysis and performance testing

Spoiler: ArrayList's insertion and query operations are much faster than LinkedList ArrayList characteristic The bottom layer is realized by array, with fast query speed and slow addition, deletion and modification speed (in theory) Thread unsafe Common methods of ArrayList import java.util.ArrayList; import java.util.Iterator; import jav ...

Posted by cyrixware on Wed, 25 May 2022 15:49:26 +0300

Look at the animation algorithm: sorting - cardinal sorting

brief introduction In the previous article, we talked about count sorting, but count sorting has a limitation, because the count array is limited. If the range of elements in the array is too large, it is unrealistic to use count sorting, and its time complexity will expand. The way to solve the large-scale element sorting is cardinality sortin ...

Posted by Democreous on Wed, 11 May 2022 15:44:24 +0300

Tips collection | 10 common array operation methods of JavaScript

Abstract: This article shows you the tips of array in daily development, which are worthy of reference and learning. In Javascript in the second stage of Web front-end development, array is an important and common knowledge point. We often store data in arrays. We will use it to traverse arrays or replace array elements in daily development. Le ...

Posted by Mikester on Wed, 04 May 2022 00:38:05 +0300

[Javascript Basics] Array methods and their applications

Check if it is an array instanceof operator, which can determine whether an object belongs to a certain type Array.isArray() is used to determine whether an object is an array, isArray() is a method provided in HTML5 var arr = [1, 23]; var obj = {}; console.log(arr instanceof Array); // true console.log(obj instanceof Array); // false ...

Posted by jonah on Sun, 01 May 2022 23:09:19 +0300

js array & common methods of string

Common methods of array includes() Used to judge whether there is an element in the array and return a Boolean value const arr = [1, 2, 3, 4, 5] console.log(arr.includes(4)) // true forEach() The most commonly used method of traversing an array. This method will not change the original array and has no return value. const arr = [1, 2, 3, 4 ...

Posted by Renegade85 on Fri, 29 Apr 2022 12:41:59 +0300

Stack (array simulation stack, implement simple calculator)

An overview of the stack 1.1 What is a stack A stack is a collection type based on a first-in-last-out (FILO-First In Last Out) strategy. A stack is a special linear list that restricts the insertion and removal of elements to the same end. One end that allows insertion and deletion of elements is the changing end, called the top of th ...

Posted by ts2000abc on Thu, 28 Apr 2022 16:54:25 +0300

OS command -- operation of array in shell

Array definition, array definition and script writing, which are often used in shell deployment, are summarized in this article. Array introduction shell array is divided into index array and associative array. The biggest difference between them is that the elements of associative array are unordered, composed of key value pairs in a specific ...

Posted by MikeL7 on Thu, 14 Apr 2022 02:20:33 +0300

Basic operation and simple application of one-dimensional tree array

basic operation 1, Repair area Luogu P3374 Title Description If you know a sequence of numbers, you need to do the following two operations: Add xx to a number Find the sum of each number in a certain interval Input format The first row contains two positive integers n and m, which respectively represent the number of numbers in the s ...

Posted by Rony on Mon, 11 Apr 2022 13:21:42 +0300

Understand ArrayDeque

1. Preface We often use two data structures in actual software development: Stack and Queue. The Java language has a class that implements a Stack, but Stack is an ancient class with poor performance. Java provides the Queue interface, but does not provide the Queue implementation class. When we need to use Stack or Queue, ArrayDeque is re ...

Posted by Koobazaur on Mon, 11 Apr 2022 00:22:10 +0300