One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle Functions on Resize |
Create DOM Elements | Conditionals |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
// - - - Pre Order - - - | |
const PreOrder = (tree, cb) => { | |
cb(tree.val); | |
if (tree.left) { | |
PreOrder(tree.left, cb); | |
} | |
if (tree.right) { | |
PreOrder(tree.right, cb); |
var permute = function(nums) { | |
nums = nums.join("").split(""); //convert to strings so you can concat values | |
var counter = 0; | |
var rounds = nums.length; | |
var fixed; | |
var result = []; | |
function recurse(nums,counter,rounds) { | |
if(rounds) { | |
rounds--; |
//all nodes to the right and above current can be added to the value of the current node | |
//***How can I think about this? I try thinking about it visually and it's very slow to draw out the call stack | |
//is there a more effective way ? Often I get lost in the call stack. | |
var sum = 0; | |
var convertBST = function(root) { | |
if(root === null) return null; | |
convertBST(root.right); | |
root.val += sum; |
//create freq obj for each letter, iterate over | |
//if even, increment a counter of its value | |
//if odd > 1, increment counter value - 1 | |
//if odd = 1, dont count it. | |
//at end you can add 1 to account for letters that have freq of one. (create variable for this) | |
//can only happen once (assuming letter w/ freq of 1 exists.) | |
//ex's. '' - 0, abc - 1, abbc - 3, aaabb - 5, zzz - 3, aaabbcde- 5 | |
var longestPalindrome = function(s) { | |
var freq = {}, longest = 0, hasOdd = false; |
/* | |
The first solution I thought of was: | |
turn both strings into arrays | |
sort both strings (js native sort method) | |
loop through the arrays | |
when the letters aren't equal return the letter in the t array | |
or if they're all equal return the letter at the end | |
But using the sort method means the time complexity at worst > O(n). |
Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.
My top contenders, mostly based on popularity / community etc:
Mostly about MVC (or derivatives, MVP / MVVM).
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bill Starr 5x5: Modified</title> | |
<link href="CSS/BillStarr.css" rel="stylesheet" type="text/css"> | |
<link href='https://fonts.googleapis.com/css?family=Montserrat:700' rel= | |
'stylesheet' type='text/css'> | |
<style id="jsbin-css"> | |
.banner { |