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
def foo() { | |
var bar = 42 | |
} |
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
function foo() { | |
var bar = 42; | |
return bar; | |
} |
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
def foo() { | |
println('bar') | |
} |
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
function foo() { | |
console.log('bar'); | |
} |
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
[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 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
[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 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.copyWithin(target, start, end) |
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
'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 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 a, b, c; | |
try { | |
b = 'foo'; | |
a = nonExistent; | |
c = 'bar'; | |
} catch(e) {} | |
console.log(a, b, c); // 'foo', undefined, undefined |
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
#!/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 |