myString.indexof('[형]')
It returns the starting index of the parameter.
It can find if the whole part is in the string or not.
When we copy array/object, and if there is another array/object in the original array or object, then an address of the array/object is copied not values.
It means copied array/object which belongs to the original array/object is no more individual array/object.
If we want to copy values not address of array, we can use slice() method. This can happen, because slice() method returns the array itself, if we pass no parameter. In this case, original array and the copied array is different array, because they have different addresses.
We can not reassign value, if we use const keyword. However, if array/object is assigned, we can change the value by using methods.
'프로그래밍' 카테고리의 다른 글
2023-06-17 html (0) | 2023.06.17 |
---|---|
2023-06-15 html (0) | 2023.06.16 |
2023-05-16 javascript_array (0) | 2023.05.16 |
2023-05-13 javascript (0) | 2023.05.13 |
2023-05-11 javascript (0) | 2023.05.11 |