Could someone take a look over my code.
I had a few issues with this.
Going through the inner loop, I ended up assigning the array of kittens to a variable and looped through that.
The String manipulation bit, I felt that there was three use cases.
[1] If there is only one name in the object. It should only reurn the name with a ‘.’
[2] The last name in the string should have: ‘and’ preceding the name and a ‘.’
[3]Every name should be separated by a space and a comma.
Grammar is important, no?
@drgaud I am so sorry about this — it has taken your post to realise that the example will work when you put the code into the live example on the assessment page, but it won’t work locally, or on a site like codepen. All because of CORS security restrictions ;-\
So, I’ve changed the description on the assessment page to say that you must write the code in the live example, otherwise it won’t work.
Thanks man, sorry to of thrown a COR(r)S problem: hope it didn’t leave you breathless
I did manage to fix the general CORS problem on my local dev evnviroment by setting the IIS to accept CORS by finding this link (and it took me ages, when I was like pre-padawan.)
But yeah If you are running VS Code and have not other server installed like a LAMP server (AMPPS) and just install IIS the live server mode on the VS Code will work with CORS like a treat, kinda took ma breath away when I found out about CORS and the whole browser security, and that opened up the whole can of ‘wtf is the browser actually’, which was really interesting…
(only some people will get the jokes the rest are just so young …and I make no apologies for them!).
I was looking through that page, I think it would detract from the context of the page and setting up python HTTPSimpleServer . a mention about server setup prehaps a link to external docs Python docs that would let the reader learn more about setting up the server: I did find after a quick google search how to fix the issue on that server on this Enabling CORS on Python SimpleServer .
Personally, reflecting on the time I took to get google fonts to load on my local server after constantly getting railroaded by CORS helped me understand the browser better, I researched the problem and found a working solution to it…
The MDN docs on HTTP CORS issues and other site-security concerns are really well documented, I reckon maybe a bit on VS Code and a quick setup of a text editor with a local server running, where it could talk about any potential CORS there, prehaps.
Like I said, I think talking about IIS there would be a bit of a curveball, as it would detract from the module that involves using Python (which I cant wait to get to). Plus IIS isnt really in the scope I feel of the teaching materials that you provide. Plan is to move to node as soon as possible and shake the crutches of microsoft.
(and thanks man; I had a elder sister who used to try to sing along with them with accents and everything-they were horrible days)