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
/******* | |
* Variable Mutation & Coercion | |
* To mutate a variable once it has been defined means to alter its value. | |
*/ | |
var firstname = 'john'; | |
console.log(firstname); | |
//1.String Type | |
var lastname = 'smith'; |
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
var firstname = 'john"'; | |
console.log(firstname); | |
//String Type | |
var lastname = 'smith'; | |
//Number Type | |
var age = 28; | |
console.log(age); |
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
//Install Swift Linit | |
//brew install swiftlint | |
//Run Swiftlint autocorrect while building app. | |
//Build Phases => New Run Script Phase | |
if which swiftlint >/dev/null; then | |
swiftlint autocorrect |
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
// npm init -y | |
//npm install express --save | |
const path = require('path') | |
const express = require('express') | |
console.log(__dirname); |
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
// npm init -y | |
//npm install express --save | |
const express = require('express') | |
const app = express() |
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
// npm init -y | |
//npm install express --save | |
const express = require('express') | |
const app = express() |
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
//Install HTTP Request | |
// npm init -y | |
// npm i request | |
const request = require('request') | |
const wheather = (latitude,longitude,callback) => { |
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
const name ='rinto' | |
const age = 10 | |
const user = { | |
name, | |
age, | |
location:'thrissur' | |
} | |
console.log(user) |
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
//Install HTTP Request | |
// npm init -y | |
// npm i request | |
const request = require('request') | |
const wheather = (latitude,longitude,callback) => { |
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
const geoCode = (address,callback) => { | |
const gioCodeURL = 'https://api.mapbox.com/geocoding/v5/mapbox.places/'+ encodeURIComponent(address) + '.json?access_token=pk.eyJ1IjoicmludG8iLCJhIjoiY2p6NmllczBiMG1nbjNucG5qZjVqOXZwZSJ9.qu2LrgatHMB-so2E4oHaFA&limit=1' | |
request({url:gioCodeURL,json:true}, (error,response) => { | |
if (error) { | |
callback('Unable to connect to wheather API',undefined) | |
} else if (response.body.features.length == 0){ | |
callback('Unable to find location, try another location',undefined) | |
} else { | |
const latitude = response.body.features[0].center[0] |