Skip to content

Commit 2a87912

Browse files
committed
Update readme file
1 parent 1d7bd48 commit 2a87912

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,26 @@ setCookie("username", "Abdul Halim", "Fri, 31 Dec 2023 23:59:59 GMT");
144144
setCookie("email", "[email protected]", "Fri, 31 Dec 2023 23:59:59 GMT");
145145
```
146146

147+
**Explanation:** The setCookie function sets cookies with the provided key-value pairs and expiration date/time.
148+
147149
```javascript
148150
getAllCookiesAsObject();
151+
152+
Output: { username: "Abdul Halim", email: "[email protected]" }
149153
```
150154

155+
**Explanation:** The getAllCookiesAsObject function retrieves all cookies as an object. In this case, the cookies set previously with the keys "username" and "email" are returned as an object.
156+
151157
```javascript
152158
localStorage.setItem("test", "123");
153159

154160
getAllLocalStorageItems();
161+
162+
Output: { test: "123" }
155163
```
156164

165+
**Explanation:** The getAllLocalStorageItems function retrieves all items stored in the local storage as an object. In this case, the item with the key "test" and value "123" is returned.
166+
157167
#### Number
158168

159169
- `getRandomNumber(min, max)`: Generates a random integer within the given range.

readme.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,26 @@ setCookie("username", "Abdul Halim", "Fri, 31 Dec 2023 23:59:59 GMT");
145145
setCookie("email", "[email protected]", "Fri, 31 Dec 2023 23:59:59 GMT");
146146
\`\`\`
147147
148+
\**Explanation:\** The setCookie function sets cookies with the provided key-value pairs and expiration date/time.
149+
148150
\`\`\`javascript
149151
getAllCookiesAsObject();
152+
153+
Output: { username: "Abdul Halim", email: "[email protected]" }
150154
\`\`\`
151155
156+
\**Explanation:\** The getAllCookiesAsObject function retrieves all cookies as an object. In this case, the cookies set previously with the keys "username" and "email" are returned as an object.
157+
152158
\`\`\`javascript
153159
localStorage.setItem("test", "123");
154160
155161
getAllLocalStorageItems();
162+
163+
Output: { test: "123" }
156164
\`\`\`
157165
166+
\**Explanation:\** The getAllLocalStorageItems function retrieves all items stored in the local storage as an object. In this case, the item with the key "test" and value "123" is returned.
167+
158168
#### Number
159169
160170
- \`getRandomNumber(min, max)\`: Generates a random integer within the given range.

0 commit comments

Comments
 (0)