Created
September 10, 2014 17:37
-
-
Save Macariom01/674beff4729ac0ed4c14 to your computer and use it in GitHub Desktop.
Shows how to access data form a gon var
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 gon.videos var is an array of objects | |
| if (gon.videos.length >= 1){ | |
| for ( var i = 0; i < gon.videos.length; i++ ){ | |
| if( (gon.videos[i].lat < latUpperBound) && (gon.videos[i].lat > latLowerBound) && (gon.videos[i].long < lngUpperBound) && (gon.videos[i].long > lngLowerBound) ){ | |
| videoList.push(gon.videos[i]); | |
| } // closes if( (gon.videos[i].lat... | |
| } //closes for loop | |
| } else{ | |
| videoList.push(gon.videos); | |
| } //closes else | |
| This also works if its not an array | |
| console.log("gon.videos.lat = ",gon.videos.lat); | |
| console.log("gon.videos.long = ",gon.videos.long); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment