Browse Source

exercise 3

master
Bram Dieudonne 2 years ago
parent
commit
fd95151326
1 changed files with 34 additions and 1 deletions
  1. 34
    1
      exercise_3.js

+ 34
- 1
exercise_3.js View File

@@ -5,4 +5,37 @@ if (String(num).includes('.')) {
}
else {
console.log(String(num).length);
}
}



let dna = " TCG-TAC-gaC-TAC-CGT-CAG-ACT-TAa-CcA-GTC-cAt-AGA-GCT ";
dna = dna.trim().toUpperCase().replace('GCT', 'AGG');

if (dna.indexOf('CAT')) {
console.log('CAT FOUND');
} else {
console.log('CAT NOT FOUND');
}


let seq = dna.slice(16, 19);

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

console.log(`${dna.slice(4, 7).toLowerCase()}o ${dna.slice(40, 43).toLowerCase()}`);





let lang = 'JavaScript';

console.log(lang.slice(0, 1) + lang.slice(4, 5));
console.log(lang.replace('ava', '').replace('cript', ''));
console.log(`The abbreviation for 'JavaScript' is '${lang.slice(0, 1) + lang.slice(4, 5)}'.`);


let title = "title case".replace('t', 'T').replace('c', 'C');
console.log(title);

Loading…
Cancel
Save