Skip to content

Instantly share code, notes, and snippets.

View lenafaure's full-sized avatar

Lena Faure lenafaure

View GitHub Profile
var map;
var infowindow;
// Defining the keywords for filtering the search
var searchwords = "agence+web";
// Initiate Map
function initMap() {
var paris = {lat: 48.8704907, lng: 2.3309359};
map = new google.maps.Map(document.getElementById('map'), {
// Create array for storing results
var agencies = [];
function callback(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
//Fetch the ID of each Place returned by the Radar Search
var request = {
// Using setTimeout and closure to overcome limit of 10 queries / second for getDetails
(function (j) {
var request = {
placeId: results[i]['place_id']
};
service = new google.maps.places.PlacesService(map);
var map;
var infowindow;
var searchwords = "agence+web";
// Initiate Map
function initMap() {
var paris = {lat: 48.8704907, lng: 2.3309359};
map = new google.maps.Map(document.getElementById('map'), {
center: paris,
rockStar = “Mick Jagger”;
var rockStar;
console.log(rockStar); // Prints “Mick Jagger”
console.log(rockStar); // Prints “undefined”
var rockStar = “Mick Jagger”;
var rockStar;
rockStar = “Mick Jagger”;
var rockStar;
console.log(rockStar);
rockStar = “Mick Jagger”;
movieStar();
function movieStar() {
  var name = “Meryl Streep”;
  console.log(name);
}
function movieStar() { // function declaration is moved to the top of the global scope
  var name; // variable declaration is moved to the top of the local scope 
  name = “Meryl Streep”; // variable assignement is left in place
  console.log(name);
}
movieStar(); // Prints “Meryl Streep”