Data Strucutures Modern Operatos and Strings
Data Strucutures Modern Operatos and Strings
1.De-
Folder location ⬇️ structuri
C:\Users\patel\Desktop\Js\JavaScript\Data Structures, Modern Operators and Strings\Destructuring Arrays
Output of code:
1.6 If not know how many array elements present in the array
2.2: If you don't know whether the object element is present or not
3.1: If you want to copy all elements of the array in a new array
3.2: If you want to print array values without a loop then use
4. Rest
Folder Location
C:\Users\patel\Desktop\Js\JavaScript\Data Structures, Modern Operators and
Strings\Rest Pattern and Parameters
4.2: Objects
4.3: Example
OR
5.1: Use Any data type, return any data type, short-circuiting
AND
The output of code:
Example:
Using entries()
8.2: If you want to print elements with their index then write like this
Example:
10.2: Methods
This work only return not console.log else it print both
The output of code:
This work only returns not console.log else it print both Example below
Folder location
C:\Users\patel\Desktop\Js\JavaScript\Data Structures, Modern Operators and
Strings\Looping Objects (Object Keys, Values, and Entries)
Set objects are collections of values. A value in the set may only occur once; it is
unique in the set's collection. You can iterate through the elements of a set in
insertion order. The insertion order corresponds to the order in which each
element was inserted into the set by the add() method successfully (that is, there
wasn't an identical element already in the set when add() was called).
Example:
2. Example
12.6: Example
The Output of code:
The Map object holds key-value pairs and remembers the original insertion
order of the keys. Any value (both objects and primitive values) may be used as
either a key or a value.
13.1: Creating Map And Adding Value, For adding value we use (set) and you can
also use Int for key
13.3: You can access map values by using get and calling with keys
The output of code:
13.8.1: Passing array but this gone not work for calling with key Example below
The output of code:
14.4: Converting a map to array and getting map value and key
16.1: Getting element by index number like array Or You can direct pass string
16.2: Find length of String You can also do with direct pass string
16.4: slice()
16.4.1: slice method
OR second method
17.4: Checking if the string includes some character or not Using includes()
17.5: The startsWith() method determines whether a string begins with the
characters of a specified string, returning true or false as appropriate.