A Pen by Shashwat Bhatt on CodePen.
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
| let inputArray = | |
| [[0, 1, 2, 3, 4], | |
| [5, 6, 7, 8, 9], | |
| [10, 11, 12, 13, 14], | |
| [15, 16, 17, 18, 19]]; | |
| //This function will traverse from top-left to bottom-right | |
| function spiralTLToBR(array) { | |
| let result = []; | |
| // get the first row. |
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 App = React.createClass({ | |
| getInitialState: function(){ | |
| return { | |
| active: true | |
| } | |
| }, | |
| handleClick: function(){ | |
| this.setState({ | |
| active: !this.state.active | |
| }); |
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 CommentList = React.createClass({ | |
| render: function() { | |
| var commentNodes = this.props.data.map(function (comment) { | |
| return ( | |
| <Comment author={comment.author}> | |
| {comment.text} | |
| </Comment> | |
| ); | |
| }); | |
| return ( |