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
//Exercise 5 [_.chain(value)] | |
/*We have a list of words that we want to modify. | |
['Test', 'Hello', 'World', 'Node', 'JavaScript'] | |
We want to modify each word so that they are all appended with the word Chained, converted to uppercase, and sorted by alphabetical order. The result should look like this: | |
['HELLOCHAINED', 'JAVASCRIPTCHAINED', 'NODECHAINED', 'TESTCHAINED', 'WORLDCHAINED'] | |
*/ |
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
//Exercise 2 Separation of Concerns 1 | |
//Separation of Concerns Part 1 | |
/*take the 4 methods and any variables that relate to | |
balance management and move them to balanceManager.js. Then, back in | |
vendingMachine.js, change the method of calling those functions from this | |
to our new balanceManager | |
*/ | |
var balance = 0; |
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
//Using setTimeout, print the string 'TIMED OUT!' after 300ms. | |
setTimeout(() => { | |
console.log('TIMED OUT!') | |
}, 300) |
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 identity(args) { | |
return args; | |
} | |
module.exports = identity; |
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
// -> Create an object called 'robot' using an object literal | |
// -> robot should have a property 'smart' with value true | |
var robot = { | |
smart: true | |
}; | |
// -> Claim the result robot.smart | |
claim(robot.smart, true); | |
// ------------------------------------------------ |
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 _ = require("lodash"); | |
var worker = function(users) { | |
return _.where(users, {active: true}); | |
}; | |
module.exports = worker; |
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
//Exercise 1 | |
/*Scopes | |
The main type of scope in Javascript is Lexical Scoping. Present in the language | |
from the very beginning, this is the scope created within a function, and the | |
one most developers are familiar with.[1] | |
ES6 recently defined Block Scoping. This scope is created within curly braced | |
blocks.[2] |
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
console.log("a: "+a+", b: "+b+", c: "+c);//a: 1, b: 5, c: 6 |
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 | |
/** | |
* Plugin Name: Add taxonomy post type | |
* Description: Easy add new taxonomy to your post type | |
* Plugin URL: http://# | |
* Author: Musykuna Ann | |
* Author http://# | |
* Version: 1.0 | |
*/ | |
function create_taxonomy_to_cars() { |
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 | |
/** | |
* Plugin Name: Accordion widget | |
* Description: Accordion widget | |
* Plugin URL: http://# | |
* Author: Musykuna Ann | |
* Author http://# | |
* Version: 1.0 | |
*/ | |
/** |