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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| let searchText = "Hector" | |
| let property = "name" | |
| let nameList : [Dictionary<String,String>] = [ | |
| ["name": "Alex", "lastName": "Manzella"], | |
| ["name": "Hector", "lastName": "Zarco"], |
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
| import {parse} from 'gh-emoji'; | |
| async function() { | |
| const result = await parse('hi :alien:'); | |
| console.log(result === 'hi <img src=".......'); | |
| } |
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
| server.post('/users', (request, db) => { | |
| let id = request.body.user.id; | |
| let user = db.create(User, {id: id, firstName: '...'}); | |
| let user = UserFactory({id: id, firstName: '...'}); | |
| db.insert(User, 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
| const elements = document.querySelectorAll('a') | |
| elements.forEach(a => console.log(a.getAttribute('href'))) |
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
| <a href="www.medium.com">Medium</a> | |
| <a href="www.google.com">Google</a> | |
| <a href="www.github.com">github</a> |
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
| Array.prototype.slice.call(elements, 0) | |
| //Or | |
| [].slice.call(elements, 0) |
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
| $(elements).each((index, a) => console.log(a.getAttribute('href'))); |
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
| Array.from(elements).forEach(a => console.log(a.getAttribute('href'))) |
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
| [...elements].forEach(a => console.log(a.getAttribute('href'))) |
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
| for (var a of elements) { | |
| console.log(a.getAttribute('href')) | |
| } |