Getting started:
Related tutorials:
// Reference: https://stackoverflow.com/a/18234552/7393218 | |
const message=[]; | |
const say = (someString) => { | |
if (someString) { | |
message.push(someString); | |
return say | |
} | |
console.log(message.join(' ')); | |
} |
// Search letter wise in an array using JavaScript | |
var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']; | |
const result = words.filter(word => word.indexOf('des') !== -1); | |
console.log(result); // > Array ["destruction"] |
{ | |
"meta": { "theme": "elegant" }, | |
"basics": { | |
"name": "Ashish Kapoor", | |
"label": "Senior Software Engineer", | |
"picture": "https://avatars3.githubusercontent.com/u/5203107?s=400&u=a2ec71f26f786eef2d311a338d88cc02536f5fd2&v=4", | |
"email": "[email protected]", | |
"phone": "+91 9899 771 880", | |
"website": "https://medium.com/@kapoor", | |
"summary": "A process-oriented professional with over 6 years of experience in the software engineering discipline. Currently, a software consultant at Rill Data, former sr. software engineer at Quid, a science enthusiast, and sometimes a vocalist. Inclined towards solving problems in big data, automotive, and educational startups with extensive experience building technology platforms, apps, websites in many sectors, and holds a master's degree in computer applications. A machine learning, and music enthusiast. Also, the former organizer of the Swift Delhi meetup community.", |
Getting started:
Related tutorials:
import UIKit | |
let numbers = [1,2,3,4,5,6,7,8,9] | |
struct Person { | |
let name: String | |
let age: Int | |
init(name: String, age: Int) { | |
self.name = name |
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
let calendar = NSCalendar.currentCalendar() | |
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
let now = NSDate() | |
let earliest = now.earlierDate(date) | |
let latest = (earliest == now) ? date : now | |
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
if (components.year >= 2) { | |
return "\(components.year) years ago" |
[ | |
{"name":"Israel","dial_code":"+972","code":"IL"}, | |
{"name":"Afghanistan","dial_code":"+93","code":"AF"}, | |
{"name":"Albania","dial_code":"+355","code":"AL"}, | |
{"name":"Algeria","dial_code":"+213","code":"DZ"}, | |
{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"}, | |
{"name":"Andorra","dial_code":"+376","code":"AD"}, | |
{"name":"Angola","dial_code":"+244","code":"AO"}, | |
{"name":"Anguilla","dial_code":"+1 264","code":"AI"}, | |
{"name":"Antigua and Barbuda","dial_code":"+1 268","code":"AG"}, |
import UIKit | |
// Stack and Generics implementation in Swift 3.1 | |
class Node<T> { | |
let value: T | |
var nextNode: Node<T>? | |
var prevNode: Node<T>? | |
init(value: T) { |
import UIKit | |
// Stack implementation in Swift 3.1 | |
class Node { | |
let value: Int | |
var nextNode: Node? | |
init(value: Int) { | |
self.value = value |