This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i,l, | |
str = 'Mary had a little lamb, Its fleece was white as snow, And every where that Mary went The lamb was sure to go;', | |
poetryM = {'stanza':[[0,109]],'line':[[0,23],[24,53],[54,84],[85,109]]}; | |
console.log('the poem is '+str.length+' characters long'); | |
for(i=0,l=poetryM.line.length;i<l;i++){ | |
console.log('line '+i+': '+str.slice(poetryM.line[i][0],poetryM.line[i][1])); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the poem is 109 characters long | |
line 0: Mary had a little lamb, | |
line 1: Its fleece was white as snow, | |
line 2: And every where that Mary went | |
line 3: The lamb was sure to go; |
NewerOlder