1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- var geoLocate, i, index, j, len, len1, loc, location, storeLocations1, storeLocations2, storeLocations3;
- storeLocations1 = ['Orlando', 'Winter Park', 'Sanford'];
- storeLocations1.forEach(function(location, index) {
- return console.log(`Location ${index}: ${location}`);
- });
- for (index = i = 0, len = storeLocations1.length; i < len; index = ++i) {
- location = storeLocations1[index];
- console.log(`Location ${index}: ${location}`);
- }
- for (index = j = 0, len1 = storeLocations1.length; j < len1; index = ++j) {
- location = storeLocations1[index];
-
- console.log(`Location ${index}: ${location}`);
- }
- storeLocations2 = (function() {
- var k, len2, results;
- results = [];
- for (k = 0, len2 = storeLocations1.length; k < len2; k++) {
- loc = storeLocations1[k];
- results.push(`${loc}, FL`);
- }
- return results;
- })();
- console.log(storeLocations2);
- geoLocate = function(loc) {
- return `${loc}, USA`;
- };
- console.log((function() {
- var k, len2, results;
- results = [];
- for (k = 0, len2 = storeLocations1.length; k < len2; k++) {
- loc = storeLocations1[k];
- if (loc !== 'Sanford') {
- results.push(geoLocate(loc));
- }
- }
- return results;
- })());
- storeLocations3 = (function() {
- var k, len2, results;
- results = [];
- for (k = 0, len2 = storeLocations1.length; k < len2; k++) {
- loc = storeLocations1[k];
- if (loc !== 'Sanford') {
- results.push(loc);
- }
- }
- return results;
- })();
- console.log(storeLocations3);
|