This file contains 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
def foo() { | |
println('bar') | |
} |
This file contains 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
function foo() { | |
console.log('bar'); | |
} |
This file contains 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
[1, 2, 3, 4, 5, 6, 7, 8].copyWithin(0, 3); | |
// copies the values from index 3 to the end of the array ( 4, 5, 6, 7, 8 ) | |
// plays them in place on the array starting at 0 ( value 1 ) | |
// returns [4, 5, 6, 7, 8, 6, 7, 8] |
This file contains 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
[1, 2, 3, 4, 5, 6, 7, 8].copyWithin(0, 3, 5); | |
// copies the values from index 3 to 5 ( 4, 5 ) | |
// plays them in place on the array starting at 0 ( value 1 ) | |
// returns [4, 5, 3, 4, 5, 6, 7, 8] |
This file contains 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.copyWithin(target, start, end) |
This file contains 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
'use strict' | |
import React from 'react' | |
import { StyleSheet, css } from 'aphrodite' | |
class ToDoList extends React.Component { | |
constructor (props) { | |
super(props) | |
this.displayName = 'ToDoList' |
This file contains 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 a, b, c; | |
try { | |
b = 'foo'; | |
a = nonExistent; | |
c = 'bar'; | |
} catch(e) {} | |
console.log(a, b, c); // 'foo', undefined, undefined |
This file contains 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
#!/usr/bin/env node | |
const process = require('process') | |
process.chdir('/foo') | |
console.log(process.cwd()) // This logs foo | |
// but then if I run this my terminal doesn't change |
This file contains 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
<div className={(condition) ? 'grid-item Rejection Rejection--width2' : 'grid-item Rejection'}> | |
// How can I do this without repeating the grid-item and Rejection classes? | |
// Something like: | |
//<div className={"grid-item Rejection" if (condition) { "Rejection--width2" }}> |
This file contains 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 string = "www.one \ | |
www.two \ | |
www.three"; | |
var pattern = /^(www\.)\w+/gm; | |
console.log(string.match(pattern)); | |