Browse Source

Strings: correction in class

master
AzureAD\SigridLievens 2 years ago
parent
commit
e830149be4
1 changed files with 9 additions and 1 deletions
  1. 9
    1
      strings.js

+ 9
- 1
strings.js View File

@@ -37,8 +37,15 @@ if (dna.includes('CAT')) {
else {
console.log('CAT not found');
}
/* andere oplossing*/
if (dna.indexOf('CAT') > -1) {
console.log('CAT found');
}
else {
console.log('CAT not found');
}

console.log(dna.slice(4 * 4, (5 * 4) - 1));
console.log(dna.slice(16, 19));

console.log(`The DNA strand is ${dna.length} characters long.`);

@@ -48,6 +55,7 @@ let language = 'JavaScript'
console.log((language.slice(0, 1)) + language.slice(4, 5));

console.log(language[0] + language[4]);
/* console.log(language.replace('ava','').replace('cript',''));*/

console.log(`The abbreviation for 'JavaScript' is '${language[0] + language[4]}'.`);


Loading…
Cancel
Save