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 TodoItem = (props) => <li onClick={props.onClick}>{props.item.text}</li> | |
| class TodoList extends React.Component { | |
| render() { | |
| const { items, onClick } = this.props; | |
| return (<ul onClick={onClick}> | |
| {items.map((item, index) => | |
| <TodoItem item={item} key={index} onClick={this.handleItemClick.bind(this, item)}/>)} | |
| </ul>); | |
| } |
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
| <ul> | |
| <li *ngFor="let address of addresses"> | |
| <app-address ="address"></app-address> | |
| </li> | |
| </ul> |
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 appendChildren(decorateDivFunction) { | |
| var allDivs = document.querySelectorAll("div"); | |
| for (var i = 0; i < allDivs.length; i++) { | |
| var newDiv = document.createElement("div"); | |
| decorateDivFunction(newDiv); | |
| allDivs[i].appendChild(newDiv); | |
| } | |
| } |
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 setup() { | |
| // Write your code here. | |
| var removeEl = document.querySelectorAll('.remove'); | |
| removeEl.forEach(function(el){ | |
| el.addEventListener('click', function(e){ | |
| e.target.parentNode.remove(); | |
| }); | |
| }); | |
| } |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Avatar</title> | |
| <style> | |
| /* Write your CSS solution here (do not edit the surrounding HTML) */ | |
| .avatar{ | |
| border-radius: 50%; | |
| width: 150px; |
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
| <?php | |
| class Pipeline | |
| { | |
| public static function make_pipeline(...$funcs) | |
| { | |
| return function($arg) use ($funcs) | |
| { | |
| $var = $arg; | |
| foreach($funcs as $key) { | |
| $var = $key($var); |
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
| -- Write only the SQL statement that solves the problem and nothing else. | |
| SELECT a.name | |
| FROM employees as a | |
| WHERE a.id NOT IN ( | |
| SELECT b.managerId | |
| FROM employees as b | |
| WHERE b.managerId IS NOT NULL | |
| ) |
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
| -- Write only the SQL statement that solves the problem and nothing else. | |
| select COUNT(id) | |
| from students | |
| where students.firstName = "John" |
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
| <?php | |
| class Palindrome | |
| { | |
| public static function isPalindrome($word) | |
| { | |
| $l= strlen($word); | |
| $status=1; | |
| $i=0; | |
| while($i<$l/2 && $status==1){ |