·58453 beijing
58665 shanghai
58559 china
58652 mmm·
just return the last line "58652 mmm". Tell me why!
My code is
·lineReader.open('./city.txt', function(reader) {
if (reader.hasNextLine()) {
reader.nextLine(function(line) {
console.log(line);
var result = line.split(" ");
//console.log(result[0]+"\t"+result[1]);
});
}
});·
My file‘name is "city.txt",
·58453 beijing 58665 shanghai 58559 china 58652 mmm·
just return the last line "58652 mmm". Tell me why! My code is ·lineReader.open('./city.txt', function(reader) { if (reader.hasNextLine()) { reader.nextLine(function(line) { console.log(line); var result = line.split(" "); //console.log(result[0]+"\t"+result[1]); }); } });·