Day 7

aronson(25)
Published in
#code
Words
204
Reading
1 min
Listen
Play
9y

January 21st 2018
Hello there!

On this Sunday I did the geolocation project from the JavaScript_30days course. What this program can do is track the speed and direction of a person through their phone. The phone access the location through the geolocation api and sends back information. For this project we needed a Mac XCode, but since I have Windows I could not do that, however I coded along anyway. The code is short relatively and I think I can understand it relatively well. We used the following code to get the position of the phone :

navigator.geolocation.watchPosition

as the virtual person walks or runs or changes direction the information of the screen changes too, so it is updated in real time. Really cool!

Over at the Bootcamp, I practice JavaScript functions some more, function declarations and expressions to be more precise:

function foo() { /////////////////// var foo = function bar() {
return bar; //////////////// return nar();
} //////////////// }

And also we covered function scope which is a really important subject. Basically the variables declared in a function exists only in that function, you cannot access it from outside the function.. However a function can access a global variable.

Have a good one!

Day 7 | Ecency