Apply new format to snippets and template
This commit is contained in:
@ -5,7 +5,7 @@ tags: browser,string,intermediate
|
||||
|
||||
Serialize a cookie name-value pair into a Set-Cookie header string.
|
||||
|
||||
Use template literals and `encodeURIComponent()` to create the appropriate string.
|
||||
- Use template literals and `encodeURIComponent()` to create the appropriate string.
|
||||
|
||||
```js
|
||||
const serializeCookie = (name, val) => `${encodeURIComponent(name)}=${encodeURIComponent(val)}`;
|
||||
|
||||
Reference in New Issue
Block a user