diff --git a/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md b/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md index cc2c07f279f..afe98f114e4 100644 --- a/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md +++ b/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md @@ -91,7 +91,7 @@ Your `#navbar` element should contain at least one `a` element whose `href` attr ```js const links = [...document.querySelectorAll('#navbar a')].filter( - (nav) => (nav?.getAttribute('href') || '').substr(0, 1) === '#' + (nav) => (nav?.getAttribute('href') || '').substring(0, 1) === '#' ); assert.isAbove( diff --git a/curriculum/challenges/english/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md b/curriculum/challenges/english/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md index c95a17cfc98..2a783db5833 100644 --- a/curriculum/challenges/english/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md +++ b/curriculum/challenges/english/05-back-end-development-and-apis/back-end-development-and-apis-projects/exercise-tracker.md @@ -79,7 +79,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); assert.isTrue(res.ok); if(!res.ok) { @@ -96,7 +96,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); @@ -164,7 +164,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substingr(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); @@ -198,7 +198,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); @@ -237,7 +237,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); @@ -276,7 +276,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); @@ -319,7 +319,7 @@ async(getUserInput) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }) if(res.ok){ const {_id, username} = await res.json(); @@ -363,7 +363,7 @@ async(getUserInput) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if(res.ok) { const {_id, username} = await res.json(); @@ -410,7 +410,7 @@ async(getUserInput) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, - body: `username=fcc_test_${Date.now()}`.substr(0,29) + body: `username=fcc_test_${Date.now()}`.substring(0,29) }); if(res.ok) { const {_id, username} = await res.json(); @@ -457,7 +457,7 @@ async(getUserInput) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, - body: `username=fcc_test_${Date.now()}`.substr(0,29) + body: `username=fcc_test_${Date.now()}`.substring(0,29) }); if(res.ok) { const {_id, username} = await res.json(); @@ -504,7 +504,7 @@ async(getUserInput) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, - body: `username=fcc_test_${Date.now()}`.substr(0,29) + body: `username=fcc_test_${Date.now()}`.substring(0,29) }); if(res.ok) { const {_id, username} = await res.json(); @@ -549,7 +549,7 @@ async (getUserInput) => { const res = await fetch(url + '/api/users', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - body: `username=fcc_test_${Date.now()}`.substr(0, 29) + body: `username=fcc_test_${Date.now()}`.substring(0, 29) }); if (res.ok) { const { _id, username } = await res.json(); diff --git a/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-13-large-sum.md b/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-13-large-sum.md index badc6ffd8b4..7e4db74fcb7 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-13-large-sum.md +++ b/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-13-large-sum.md @@ -278,7 +278,7 @@ function largeSum(arr) { sum = sum.toString(10); - sum = sum.substr(0, 1) + sum.substr(2); + sum = sum.substring(0, 1) + sum.substring(2); let firstTen = sum.slice(0, 10); return parseInt(firstTen, 10); diff --git a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/iban.md b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/iban.md index 151b979a3f7..dde7926e041 100644 --- a/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/iban.md +++ b/curriculum/challenges/english/10-coding-interview-prep/rosetta-code/iban.md @@ -95,10 +95,10 @@ function isValid(iban) { iban = __helpers.removeWhiteSpace(iban) if (!iban.match(/^[\dA-Z]+$/)) return false var len = iban.length - if (len != ibanLen[iban.substr(0,2)]) return false - iban = iban.substr(4) + iban.substr(0,4) + if (len != ibanLen[iban.substring(0,2)]) return false + iban = iban.substring(4) + iban.substring(0,4) for (var s='', i=0; i (nav?.getAttribute('href') || '').substr(0, 1) === '#' + (nav) => (nav?.getAttribute('href') || '').substring(0, 1) === '#' ); assert.isAbove(