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
| [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
| [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
| 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
| 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() { | |
| 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() { | |
| 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
| object Foo { | |
| def bar() { | |
| println("no semicolons here!") | |
| val xs = List(1, 2, 3, 4) | |
| xs foreach println | |
| def sumOfSquares(x: Int, y: Int) { | |
| (x * x) + (y * y) |
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
| request.onload = function () { | |
| if (this.status >= 200 && this.status < 400) { | |
| var data = JSON.parse(this.response) | |
| data.photos.photo.map(function (photo) { | |
| var image = generateImageFromPhotoObject(photo) | |
| wrapper.appendChild(image) | |
| }) | |
| } else { | |
| wrapper.innerHTML = 'We recieved an error from the Flickr API. Please try again later.' |
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* createName() { | |
| console.log(yield) | |
| } | |
| const name = createName() | |
| name.next('Jon') |