Hi, I’m Front-end Tutu. After the last article (also my first article), I feel quite good results, I am so happy to win the outstanding award of the annual essay contest.

I’ve been thinking about what to write next. I am studying data Structure and Algorithm recently. Let’s talk about data structures! I also regard this writing as a counterpoint. Input and output at the same time, otherwise learn a little useless. The following nonsense not to say, let’s begin!

Why use arrays

Suppose you have a requirement to save a list of names, like the following.

const name1 = "Little red";
const name2 = "Yellow";
const name3 = "Xiao Ming";
const name4 = "Chou";
Copy the code

But this is not the best plan, if according to this method, only part of the name. Creating a few to dozens of variables is obviously not going to work. That’s the kind of thing we can do with arrays.

const names = ["Little red"."Yellow"."Xiao Ming"."Chou"];
Copy the code

Using an array to store these names is much cleaner than declaring multiple variables.

Create and initialize an array

There are two ways to create or initialize an array.

Create an array using the new keyword

// Declare an array
const arr1 = new Array(a);// Take an array element as an argument
const arr2 = new Array("1"."2"."3"."4");
// Give the array a specified length
const arr3 = new Array(7);
Copy the code

Using the new keyword, you can simply declare the initialization of an array. In this way, you can also create an array of a specified length. Alternatively, you can pass an array element directly to its constructor as an argument.

But new isn’t the best way to create an array, there’s another way to create an array.

use[]In the form of

An array can also be created as [], which is the most common form of JS.

// create it literally
const arr1 = [];
// Arrays can be initialized with elements
const strs = ["1"."2"."3"."4"];
Copy the code

If you want to know how many elements there are in the array (that is, the length of the array), access the length property of the array.

const numbers = [1.2.3.4.5.6];
console.log(numbers.length); / / 6
Copy the code

Access elements and iterate over arrays

To access an element at a particular location in the array, you can pass the value of the element position in brackets, which can either get the desired value or assign a new value.

const numbers = [1.2.3.4.5];
console.log(numbers[0]); / / 1
console.log(numbers[1]); / / 2

numbers[2] = 5;
console.log(numbers[2]); / / 5
Copy the code

If you want all the elements in numbers, iterate through the array through the for loop, printing the elements. The for loop is a programmer’s for loop. There are other array methods that we’ll talk about next.

const numbers = [1.2.3.4.5];

for (let i = 0; i < numbers.length; i++) {
console.log(numbers[i]);
}
Copy the code

Iterating through each item through the for loop gives you all the elements in the array and prints them on the console.

Add elements

Adding elements to an array is also easy, as in numbers above.

const numbers = [1.2.3.4.5];
Copy the code

Adds elements from the end of the array

To add an element (say, 6) to an array, you simply assign the value to the element in the last empty space in the array.

const numbers[numbers.length] = 6;
Copy the code

In JS, an array is a modifiable object that grows automatically if you add elements.

Using push

Arrays have a push method that adds elements to the end of the array. Using the push method, you can add N elements.

let numbers = [0.1.2.3.4.5];
numbers[numbers.length] = 6;
numbers.push(7);
numbers.push(8.9);
console.log(numbers);
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Copy the code

And then in the last log you get the values from zero to nine.

Adds elements from the array header

Use the unshift method

The unshift method inserts elements directly into the head of an array.

let numbers = [0.1.2.3.4.5];
numbers.unshift(-2, -1);
numbers.unshift(-4, -3);
console.log(numbers);
// [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
Copy the code

Remove elements

Removes the element from the end of the array

The pop method of an array, used to delete the last element of the array.

let arr = [1.2.3.4.5];
arr.pop();
console.log(arr);
// [1, 2, 3, 4]
Copy the code

Removes an element from the head of an array

Arrays have a shift method that removes the first element of the array.

let numbers = [1.2.3.4.5.6];
numbers.shift();
console.log(numbers);
// [2, 3, 4, 5, 6]
Copy the code

Let’s say the values in the array are 1 through 6, length 6. After shift, the array is left with 2 to 6, and the length is 5. Using the Shift and unshift methods, you can simulate the data structure of a queue with an array.

Add or remove elements at any location

Using the splice method, you can simply delete a specified number of elements at a specified location or index.

let numbers = [1.2.3.4.5.6];
numbers.splice(4.2);
console.log(numbers);
// [1, 2, 3, 4]
Copy the code

In the code above, the two elements starting with index 4 are removed. Numbers [5] and numbers[6] are removed. The last values in the array are 1, 2, 3, 4.

You can also delete elements in an array using the DELETE operator.

let numbers = [1.2.3.4.5];
delete numbers[2];
console.log(numbers);
// [1, 2, empty, 4, 5]
Copy the code

You can see that the DELETE operator changes the value at numbers[2] to empty. The delete operator deletes the element, but the position remains, where the value is null. It is therefore not recommended to use elements of the DELETE operator array.

Now put the 5 and 6 back in the array, and you can use the splice method.

let numbers = [1.2.3.4.5.6];
numbers.splice(4.2);
console.log(numbers);
// [1, 2, 3, 4]

number.splice(4.0.5.6);
console.log(numbers);
// [1, 2, 3, 4, 5, 6]
Copy the code

The splice method accepts the index value that it wants to delete or insert as the first argument. The second argument is the number of elements to remove (this example is not about removing elements, so pass 0). The third argument, after that, is the value added to the array.

Two-dimensional arrays and multidimensional arrays

The following uses an example of average temperature measurements to implement a matrix (a two-dimensional array, or array of arrays).

let airTemperature = [];

airTemperature[0] = [28.22.24.26.10];
airTemperature[1] = [20.16.18.30.21];
console.log(airTemperature);
/ / [[28, 22, 24, 26, 10], [30, 20, 16, 18, 21]]
Copy the code

In the code above, the daily and hourly data are made separately. I also drew a picture from the book, just so you can understand it.

Each row is the daily data, and each column is the temperature at a different time of the day.

Iterate over the elements of a two-dimensional array

Iterating over a two-dimensional array is essentially a two-layer for loop.

let airTemperature = [];

airTemperature[0] = [28.22.24.26.10];
airTemperature[1] = [20.16.18.30.21];

for (let i = 0; i < airTemperature.length; i++) {
  console.log(airTemperature[i]);
  for (let j = 0; j < airTemperature[i].length; j++) {
    console.log(airTemperature[i][j]); }}Copy the code

The variable I represents the row and j represents the column. Each airTemperature[I] represents an array, so each location of airTemperature[I] is iterated over in the nested for loop.

Multidimensional array

Suppose you want to create a 3 x 3 x 3 matrix with each cell containing the sum of the I (rows), j(columns), and z(depth) of the matrix.

let Arrx3x3x3 = [];
for (let i = 0; i < 3; i++) {
  Arrx3x3x3[i] = [];
  for (let j = 0; j < 3; j++) {
    Arrx3x3x3[i][j] = [];
    for (let z = 0; z < 3; z++) { Arrx3x3x3[i][j][z] = i + j + z; }}}console.log(Arrx3x3x3);
/ * [[[0, 1, 2], [1, 2, 3], [2, 3, 4]], [[1, 2, 3], [2, 3, 4], [3, 4, 5]], [[2, 3, 4], [3, 4, 5], [4, 5, 6]]] * /
Copy the code

It doesn’t matter how many dimensions a data structure has; you can loop through each dimension to access all the cells.Arrx3x3x3The matrix is shown below.

So let’s print out the contents of this matrix.

for (let i = 0; i < Arrx3x3x3.length; i++) {
  for (let j = 0; j < Arrx3x3x3[i].length; j++) {
    for (let z = 0; z < Arrx3x3x3[i][j].length; z++) {
      console.log(Arrx3x3x3[i][j][z]); // here is the result of z}}}Copy the code

If it’s a 3 x 3 x 3 x 3 x 3 matrix, use a four-layer for loop, and so on. Four-dimensional arrays are rarely used in development, with two dimensions being the most common.

Js array method

Now let’s take a look at some of the array methods we’ve used.

  • concat: joining together2Or more arrays, and returns the concatenated array.
  • every: Runs the specified function on each element in the array to check whether the array element meets the criteriafalse, the remaining elements will not be detected.
  • filter: Executes the specified function on each element in the array. Returns this function returnstrueIs an array of elements.
  • forEach: Iterates over each element of the array. This method returns no value.
  • join: concatenates all elements of an array into a string.
  • indexOf: returns the index where the passed value first appears, or if no value is found- 1. (Start at the head of the array)
  • lastIndexOf: Returns the index of the last occurrence of an incoming value, or if no value is found- 1. (Start at the end of array)
  • map: Runs the specified function on each element of the array, returns the result of each call to the function to form the array.
  • reverse: Reverses the order of the elements in the array so that the first becomes the last, and the last becomes the first.
  • slice: Passes in the index value and returns the elements in the corresponding index range as a new array.
  • some: checks whether each element of the array is eligible for addition, and returns if one of the elements is eligibletrue.
  • sort: Used to sort the elements of an array.
  • toStringReturns an array as a string. (Convert array to comma-separated string)
  • valueOfAnd:toStringSimilarly, an array is returned as a string.

Concat method

If you have multiple arrays and want to combine them into one array, you can use the concat method.

let arr1 = [1.2.3];
let arr2 = [4.5.6];
let number = 7;
let arr3 = arr1.concat(arr2, number);
console.log(arr3);
// [1, 2, 3, 4, 5, 6, 7]
Copy the code

The concat method can pass arrays, objects, or other types of values to an array. The array is formed into the specified array in the order of the arguments passed in to the method. In the example above, arR2 is merged into arr1, and then the value of the number variable is merged. The final output is [1, 2, 3, 4, 5, 6, 7].

Iterative function

In addition to the for loop statement, JS has a number of built-in methods for iterating through arrays. We need an array and a function: suppose the array has values from 1 to 10; The function returns true if the elements of the array are divisible by 2, false otherwise.

let arr = [1.2.3.4.5.6.7.8.9.10];

function isEven(val) {
  return val % 2= = =0;
}
Copy the code

Every method

The every method iterates over each element in the array until it returns false.

let arr = [1.2.3.4.5.6.7.8.9.10];
console.log(arr.every(isEven));
// false
Copy the code

In the example above, the first element of the array is 1, which is not a multiple of 2, so isEven returns false, and the execution ends.

Some methods

Some, in contrast to eveny, iterates through each element of the array until the function returns true.

console.log(arr.some(isEven));
// true
Copy the code

In this case, the first even number in the array is 2. The first element to be iterated over is 1, isEven returns false. The second element to be iterated over is 2, isEven returns true, and the iteration ends.

The forEach method

The forEach method iterates through the entire array, which is the same as the for loop. Remember that the forEach method does not return a value.

arr.forEach((val) = > console.log(val % 2= = =0));
// false
// true
// false
// true
// false
// true
// false
// true
// false
// true
Copy the code

Map and filter methods

Both the map and filter methods return a new array. First look at the map method.

const myMap = arr.map(isEven);
console.log(myMap);
// [false, true, false, true, false, true, false, true, false, true]
Copy the code

The values in myMap are: [false, true, false, true, false, true, false, false, false, true]. It holds the result of the isEven function passed to the map method. So it’s easy to know which element is even. For example, myMap[0] is false because 1 is not even.

The filter method, which returns a new array of elements that isEven returns true.

const filterNumbers = arr.filter(isEven);
console.log(filterNumbers);
// [2, 4, 6, 8, 10]
Copy the code

It filters the elements in the array that are divisible by 2, but it also filters the elements in the array that meet the criteria.

The reduce method

The reduce method takes a function with four parameters: preVal(the initial value), currVal(the current element), index(the current index), and array(the array of the current element). Index and array are optional parameters. This function returns a value that will be added to the accumulator that will be returned when the reduce method stops executing. This method is useful if you want to sum all the elements of an array.

let arr = [1.2.3.4.5.6.7.8.9.10];

const myReduce = arr.reduce((preVal, currVal) = > preVal + currVal);
console.log(myReduce); / / output 55
Copy the code

ES6 adds an array method

  • @@iterator: returns an iterator object containing key-value pairs of array elements, which are returned by synchronous calls.
  • copyWithin: copies a sequence of elements in an array to the starting position specified in the same array.
  • entries: returns an array containing all key-value pairs@@iterator.
  • includes: Returns if an element exists in the arraytrueOtherwise returnfalse.
  • find: Retrieves an element from the array based on the condition given by the callback function, and returns the element if found.
  • findIndex: Retrieves an element from the array based on the condition given by the callback function, and returns the element’s index in the array if found.
  • fill: Fills the array with static values.
  • from: Used to convert array-like objects and traversable objects into real arrays.
  • keys: returns the index containing all the indexes of the array@@iterator.
  • of: Creates a new array based on the parameters passed in.
  • values: returns all the values in the array@@iterator.

for… Method of

ES6 increase the iteration array method for… The of loop, here’s how it’s used.

let arr = [1.2.3.4.5.6.7.8.9.10];
for (let i of arr) {
  // n is a member of arr
  console.log(n % 2= = =0);
}
Copy the code

@@iteratorobject

ES6 also adds an @@iterator attribute to Array, which needs to be accessed through symbol. iterator.

const arr = [1.2.3.4.5.6.7.8.9.10];
let iterator = arr[Symbol.iterator]();
console.log(iterator.next().value); / / 1
console.log(iterator.next().value); / / 2
console.log(iterator.next().value); / / 3
console.log(iterator.next().value); / / 4
Copy the code

We then call the iterator’s next method over and over again to get the values in the array. If you have 10 values in the ARR array, you call them 10 times. This is obviously impractical, but you can use for… The of loop outputs these values.

let iterator = arr[Symbol.iterator]();
for (const n of iterator) {
  console.log(n);
}
Copy the code

After iterating over the values in the array, calling iterator.next().value returns undefined.

const arr = [1.2.3.4.5.6.7.8.9.10];
let iterator = arr[Symbol.iterator]();
for (const n of iterator) {
  console.log(n);
}
console.log(iterator.next().value); // undefined
Copy the code

An array ofentries,keysandvaluesmethods

ES6 also adds three ways to get iterators from arrays.

Entries method
let aEntries = arr.entries(); // Get the iterator for the key-value pair
console.log(aEntries.next().value); // The value of position 0 is 1
console.log(aEntries.next().value); // The value of position 1 is 2
console.log(aEntries.next().value); // The value of position 2 is 3
Copy the code

Arr arrays are all numbers. Key is the position in the array, and value is the value stored in the index of the array. You can also use for… The of loop iterates over aEntries.

Keys methods

The key method returns an @@iterator containing an array index.

let aKeys = arr.keys(); // Get an iterator for the array index
console.log(aKeys.next()); // { value: 0, done: false }
console.log(aKeys.next()); // { value: 1, done: false }
console.log(aKeys.next()); // { value: 2, done: false }
Copy the code

The keys method returns the arR array index. If there are no iterable values, akeys.next () returns an object with undefined value and true done. If the done attribute is false, there are still iterable values.

Values method

The values method returns an @@iterator containing the value of the array.

let aValues = arr.values();
console.log(aValues.next()); // { value: 1, done: false }
console.log(aValues.next()); // { value: 2, done: false }
console.log(aValues.next()); // { value: 3, done: false }
Copy the code

formmethods

The array. form method is used to convert traversable objects and array-like objects into true arrays (including Set and Map data structures). You can also create a new array from an existing array. For example, you want to copy an ARR array.

const arr = [1.2.3.4.5.6.7.8.9.10];
let arr2 = Array.from(arr);
console.log(arr2);
// [0, 2, 3, 4, 5, 6, 7, 8, 9, 10]

// Can traverse object to array
let obj = {
  0: "1".1: "2".2: "3".length: 3};console.log(Array.from(obj));
// ['1', '2', '3']

// Array-like objects are converted to real arrays. Arguments are array-like objects
function args() {
  console.log(Array.from(arguments));
}

args(1.2); // [1, 2]
Copy the code

You can also pass in a function to filter values, as shown in the following example.

let evens = Array.from(arr, (x) = > x % 2= = =0);
console.log(evens);
// [false, true, false, true, false, true, false, true, false, true]
Copy the code

The above code creates an array of evens with values true (even in the original array) or false (odd in the original array).

Array.ofmethods

The array. of method creates a new Array based on the parameters passed in.

let arr2 = Array.of(1);
let arr3 = Array.of(2.3.4.5.6.7.8);
console.log(arr2); / / [1]
console.log(arr3); // [2, 3, 4, 5, 6, 7, 8]
Copy the code

You can also use this method to copy an existing array as follows.

let arrCopy = Array.of(... arr3);console.log(arrCopy); // [2, 3, 4, 5, 6, 7, 8];
Copy the code

The above code has the same effect as array.form (arR3).

fillmethods

The fill method fills an array with the given value.

let arrCopy = Array.of(1.2.3.4.5.6);
Copy the code

The length of the arrCopy array is 6, proving that there are 6 positions. Look at the code below.

let arrCopy = Array.of(1.2.3.4.5.6);
arrCopy.fill(0);
console.log(arrCopy);
// [0, 0, 0, 0, 0, 0]
Copy the code

All positions in the arrCopy array will be 0. You can also specify the index to start populating, as shown below.

arrCopy.fill(2.1);
console.log(arrCopy);
// [1, 2, 2, 2, 2]
Copy the code

In the example above, all positions in the array from 1 are 2.

You can also specify the index to end the population.

arrCopy.fill(1.3.5);
console.log(arrCopy);
// [1, 2, 3, 1, 1, 6]
Copy the code

In the above example, 1 is padded to the array indexes 3 through 5 (excluding 3 and 5).

Fill is very useful when you want to create arrays and initialize values, as shown below.

let ones = Array(6).fill(1);
console.log(ones); // [1, 1, 1, 1, 1]
Copy the code

Here we create an array of length 6 with all values of 1.

copyWithinmethods

The copyWithin method copies a list of elements in an array to the location specified in the same array.

let copyArray = [1.2.3.4.5.6];
Copy the code

Imagine copying the values 4, 5, and 6 into the first three positions of the array to get the array [4, 5, 6, 4, 5, 6], using the following code.

copyArray.copyWithin(0.3);
console.log(copyArray);
// [4, 5, 6, 4, 5, 6]
Copy the code

Imagine copying the values 4 and 5 (at positions 3 and 4) to positions 1 and 2. It can be done like this:

copyArray.copyWithin(1.3.5);
console.log(copyArray);
// [1, 4, 5, 4, 5, 6]
Copy the code

In this case, elements starting at position 3 and ending at position 5 (excluding 3 and 5) are copied to position 1.

Sorting elements

The most common search and sort methods are shown below. Js also provides a sorting method and a set of search methods.

The first is the antiordered output array ARR. To do this, you can use the reverse method, which reverses the order of the elements in the array.

arr.reverse();
console.log(arr);
// [10, 9, 8, 7, 6, 5, 4, 3, 2, 1];
Copy the code

You can now see that the output of arR is [10, 9, 8, 7, 6, 5, 4, 3, 2, 1].

Now look at the sort method.

arr.sort();
console.log(arr);
// [1, 10, 2, 3, 4, 5, 6, 7, 8, 9];
Copy the code

However, the output array is [1, 10, 2, 3, 4, 5, 6, 7, 8, 9]. This doesn’t look right because the sort method defaults to comparing elements to each other as strings when sorting arrays.

You can pass in your own comparison function. Because the array is full of numbers, we could write it like this.

arr.sort((a, b) = > a - b);
console.log(arr);
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
Copy the code

This code returns a negative number if b is greater than a, and a positive number if b is greater than a. If it’s equal, it returns 0. That is, if it returns a negative number, it means that a is less than B, so sort can sort the array based on the value returned.

The previous code could also represent something like this.

const arr = [1.2.3.4.5.6.7.8.9.10];
arr.sort();
console.log(arr);
// [1, 10, 2, 3, 4, 5, 6, 7, 8, 9];
function compare(a, b) {
  if (a < b) {
    return -1;
  }
  if (a > b) {
    return 1;
  }
  // a equals b returns 0
  return 0;
}
arr.sort(compare);
console.log(arr);
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
Copy the code

This is because js’s sort method takes compareFunction as an argument, which sort then uses to sort the array. In this example, we declare a function that compares the elements of an array, making the array sort in ascending order.

Custom sort

You can sort arrays of any object type, or you can create compareFunctions to compare elements. For example, the object Person has a name and an age attribute, and we want to sort by age.

const friends = [
  { name: "xiaohong".age: 20 },
  { name: "xiaoming".age: 19 },
  { name: "xiaojia".age: 23},];function compare(a, b) {
  if (a.age < b.age) {
    return -1;
  }

  if (a.age > b.age) {
    return 1;
  }
  return 0;
}

console.log(friends.sort(compare));
/ / /
// { name: 'xiaoming', age: 19 },
// { name: 'xiaohong', age: 20 },
// { name: 'xiaojia', age: 23 }
// ]
Copy the code

In this case, the output looks like this.

String sort

Let’s say I have an array like this.

let names = ["Ana"."ana"."john"."John"];
Copy the code

Sort using the sort method as shown below.

console.log(names.sort());
// [ 'Ana', 'John', 'ana', 'john' ]
Copy the code

If A is first in the alphabet, why does Ana come after John? This is because when JS compares characters, it compares them according to a kind of value called ASCII. For example, the ASCII values for A, J, A, and J are 65, 74, 97, and 106, respectively.

Although A is the highest in the alphabet, J has a smaller ASCII value than A, so it comes first.

If you pass a case-insensitive comparison function to sort, it prints [“Ana”, “Ana”, “John”, “John”].

let names = ["Ana"."ana"."john"."John"];
console.log(
  names.sort((a, b) = > {
    if (a.toLowerCase() < b.toLowerCase()) {
      return -1;
    }
    if (a.toLowerCase() > b.toLowerCase()) {
      return 1;
    }
    return 0; }));Copy the code

In this case, sort does nothing. It will be sorted alphabetically as it is now.

If you want lowercase letters to come first, you need to use the localeCompare method.

let names = ["Ana"."ana"."john"."John"];
names.sort((a, b) = > a.localeCompare(b));
console.log(names);
// [ 'ana', 'Ana', 'john', 'John' ]
Copy the code

The output looks like this.

LocaleCompare can also be used to sort accented characters.

const name2 = ["Maeve."."Maeve"];
console.log(name2.sort((a, b) = > a.localeCompare(b)));
// ['Maeve', 'Maeve']
Copy the code

The final result is shown above.

search

There are two methods for searching: indexOf, which returns the indexOf the first element that matches the argument, and lastIndexOf. The latter is the index that returns the last element that matches the parameter, as in the case of an ARR array.

const arr = [1.2.3.4.5.6.7.8.9.10];
console.log(arr.indexOf(5)); / / 4
console.log(arr.lastIndexOf(11)); // -1
Copy the code

As you can see above, the second line prints 4 and the third line prints -1 (because 11 is not in the array).

findandfindIndexmethods

const arr = [1.2.3.4.5.6.7.8.9.10];

function multipleOf(ele, index, array) {
  return ele % 13= = =0;
}

console.log(arr.find(multipleOf)); // undefined
console.log(arr.findIndex(multipleOf)); // -1
Copy the code

The find and findIndex methods receive a callback function and search for a value that satisfies the callback function criteria. In the example above, we are looking for a multiple of 13 from the array.

The difference between find and findIndex is that the find method returns the first value that satisfies the condition, while the findIndex method returns the index of that value in the array. If no value meets the criteria, find returns undefined and findIndex returns -1.

Includes method

The includes method is used to check if the array contains an element and returns true if it does, false otherwise.

const arr = [1.2.3.4.5.6.7.8.9.10];

console.log(arr.includes(5)); // true
console.log(arr.includes(11)); // false
Copy the code

If you pass a starting index to the includes method, the search starts at the location specified by the index.

const arr = [1.2.3.4.5.6.7.8.9.10];

console.log(arr.includes(4.6)); // false
Copy the code

False is printed here because there is no element 4 after index 6.

Output array is a string

If you want to print all the elements of an array as a string, you can use the toString and JOIN methods.

const arr = [1.2.3.4.5.6.7.8.9.10];
console.log(arr.toString()); / / 1,2,3,4,5,6,7,8,9,10
console.log(arr.join()); / / 1,2,3,4,5,6,7,8,9,10
Copy the code

If you want to separate elements with a different separator (for example -), you can use the Join method.

const arr = [1.2.3.4.5.6.7.8.9.10];
console.log(arr.join("-")); / / 1-2-3-1-2-3 - the 7-8-9-10
Copy the code

The join method, which I use more often to pass multiple times or dates to the back end.

So that’s the method in the JS array.

At the end

If where write wrong or not good, welcome everybody big guy to give directions! I hope you can give me a thumbs up. Try to write an article every week in the future, to improve their writing level, and share their knowledge to everyone. So tired ~ ~! From morning to 5:00 PM.