|
|
@@ -0,0 +1,51 @@ |
|
|
|
let num = 1001; |
|
|
|
let dec = 123.45; |
|
|
|
|
|
|
|
console.log(num.toString().length); |
|
|
|
console.log(dec.toString().length); |
|
|
|
|
|
|
|
let numb = 1.2; |
|
|
|
|
|
|
|
if (numb.toString().includes('.')) { |
|
|
|
console.log('It\'s a decimal.') |
|
|
|
} else { |
|
|
|
console.log('It\s a number.') |
|
|
|
} |
|
|
|
|
|
|
|
let dna = " TCG-TAC-gaC-TAC-CGT-CAG-ACT-TAa-CcA-GTC-cAt-AGA-GCT "; |
|
|
|
/*let up = dna.trim(); |
|
|
|
console.log(up.toUpperCase());*/ |
|
|
|
dna = dna.trim().toUpperCase(); |
|
|
|
console.log(dna); |
|
|
|
|
|
|
|
dna = dna.replace('GCT', 'AGG'); |
|
|
|
console.log(dna); |
|
|
|
|
|
|
|
if (dna.includes('CAT')) { |
|
|
|
console.log('CAT found'); |
|
|
|
} |
|
|
|
else { |
|
|
|
console.log('CAT NOT found'); |
|
|
|
} |
|
|
|
|
|
|
|
let codon = dna.slice(16, 19); |
|
|
|
|
|
|
|
console.log(codon); |
|
|
|
|
|
|
|
//console.log('The DNA strand is ' + dna.length + ' characters long'); |
|
|
|
|
|
|
|
console.log(`The DNA strand is ${dna.length} characters long`); |
|
|
|
|
|
|
|
let name = 'JavaScript'; |
|
|
|
|
|
|
|
/*let abbreviation = name.slice(0,1) + name.slice(4,5); |
|
|
|
|
|
|
|
console.log(abbreviation);*/ |
|
|
|
|
|
|
|
let abbreviation = name.replace('ava', '').replace('cript', ''); |
|
|
|
|
|
|
|
console.log(abbreviation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|