Help I have question

#1
Is there any difference between these two codes, i'm using jad joubrans learn javascript and they said "returns first 10 chars followed by ellipsis for long strings getDescription("Welcome to JavaScript"): expected 'Welcome to JavaScript...' to equal 'Welcome to...' returns original string when it receives a short string" both these codes fulfil the same purpose

Code 1(their code): /**

@param {string} text */ export function getDescription(text) { console.log(text); // write something in the BROWSER and see it in the console if (text.length>10) {return text.substring(0,10) + "...";} return text }

code 2(my code): /**

@param {string} text */ export function getDescription(text) { console.log(text); // write something in the BROWSER and see it in the console if (text.length>10) {return text + "...";} return text }

I dont get why they wouldnt accept my code when the only difference is the substring()
 
Top