function getNucleobaseCount (strand) {
/*
Returns occurences of nucleobases A and C respectively
*/
var countA = (strand.split("A").lenght - 1);
var countC = (strand.split("C").lenght - 1);
return countA + " " + countC;
}
但
> console.log(getNucleobaseCount("AAGCATT"))
Nan Nan
而不是预期的3 1
为什么?