This is something I have been struggling for days with.
Here previous post …
https://forum.freecodecamp.org/t/join-not-accepted/208713/2
I just found out that SLUG
can only accept ASCII characters and some dashes, hyphens, underscores and nothing more. So /
does not work.
So now I want to use /
as ASCII code in my code below.
But how to do it correctly?
<% var title = post.title %>
<% var slug = post.slug %>
<% var sluglink = [titleInLink,slug].join('/') %>
data-slug="<%= sluglink %>"
Where it reads .join('/')
, I have to use charCodeAt()
, but how?
Dec: 47
Hx: 2F
Oct: 057
HTML: /
Chr: /