Skip to content

Commit

Permalink
docs: fix ECMAScript Versions
Browse files Browse the repository at this point in the history
Example mdn#5, #6 in `Document.cookie`

Signed-off-by: Kanwal Singh <[email protected]>

fixes: mdn#4912
  • Loading branch information
Blakelist7 committed May 26, 2021
1 parent 4c02f1d commit 6338dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/en-us/web/api/document/cookie/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ <h3 id="Example_5_Check_a_cookie_existence">Example #5: Check a cookie existence
console.log('The cookie "reader" exists (ES5)')
}

//ES2016
//ES2015

if (document.cookie.split(';').some((item) =&gt; item.trim().startsWith('reader='))) {
console.log('The cookie "reader" exists (ES6)')
Expand All @@ -234,7 +234,7 @@ <h3 id="Example_6_Check_that_a_cookie_has_a_specific_value">Example #6: Check th
console.log('The cookie "reader" has "1" for value')
}

//ES2016
//ES2016 (uses includes() introduced in ES2016)

if (document.cookie.split(';').some((item) =&gt; item.includes('reader=1'))) {
console.log('The cookie "reader" has "1" for value')
Expand Down

0 comments on commit 6338dd5

Please sign in to comment.