Yay for a more declarative style of programming, nice walkthrough! :)
A tip for future reference, you can highlight code blocks by appending the name of the language, in this case javascript at the end of the three backticks, like this:
javascript
this is the result:
const hostnameAvailable = typeof window !== 'undefined' && window.hasOwnProperty('location') && window.location.hasOwnProperty('hostname'); const domain = hostnameAvailable ? window.location.hostname : null; const isLocal = domain && domain.match(/localhost|127\.0\.0\.1/); const secure = !isLocal; export default new Cookie({secure});
Ha! I knew that one but assumed the site didn’t handle it. Dummy me for assuming. Thanks for the compliment and tip!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yay for a more declarative style of programming, nice walkthrough! :)
A tip for future reference, you can highlight code blocks by appending the name of the language, in this case
javascriptat the end of the three backticks, like this:this is the result:
Ha! I knew that one but assumed the site didn’t handle it. Dummy me for assuming. Thanks for the compliment and tip!