backbone-fundamentals icon indicating copy to clipboard operation
backbone-fundamentals copied to clipboard

Error first run exercise 1

Open paulsperanza opened this issue 11 years ago • 1 comments

window.app.Todos.create({ title: ’My first Todo item’});

gives me SyntaxError: Unexpected token ILLEGAL

I don't see create on the Todos collection so I am not sure what I am missing.

paulsperanza avatar Oct 30 '13 20:10 paulsperanza

This is actually caused by #488 - code snippets apparently sometimes use non-ascii apostrophe characters. This can be easily reproduced in browser's JS console: var x = ’My first Todo item’ (github's code highlighting makes it much more evident, if you had used the backticks code highlighting you'd spot the problem immediately)


Try this instead: (replaced with proper "keyboard" apostrophes):

window.app.Todos.create({ title: 'My first Todo item'});

kryger avatar Nov 10 '13 19:11 kryger