Reputation: 3481
I'm still a beginner in javascript. I copy this javascript code here
function memo(pnt){
var row = pnt.lng().toFixed(5);
row += ", ";
row += pnt.lat().toFixed(5);
row += ", ";
row += pnt.address;
row += "\n";
printOut.value += row;
}
and turn I want to asign
var lang = pnt.lng().toFixed(5);
var lat = pnt.lat().toFixed(5);
var add = pnt.address;
the row
is incremented.
but I get it wrong. what is the correct arrangement for this?
Upvotes: 0
Views: 131
Reputation: 505
The ## var ## keyword simply identifies a new variable. You don't need to have it on re-assigning a variable.
Upvotes: 0
Reputation: 48537
pnt.lng().toFixed(5) = var lang
This is wrong to start with.
If I've followed your question correctly, you'll want something like:
var lang = pnt.lng().toFixed(5);
to assign the value of pnt.lng().toFixed(5)
to lang
.
Upvotes: 3