Javascript — Week 2

Life update: I'm taking a Javascript course at General Assembly. It's about time, right? Below is some code I wrote to pick apart a large array of numbers.

// 1. What's the max number?
// UPDATE: @ljharb correctly pointed out that my solution does not work 
// for negative numbers. I changed the algorithm so max is initially set
// to be the first value in the array, and the form loop begins at the
// second value in the array. Thanks, pal.

var max = a[0];
for (var i = 1; i < a.length; i++) {
    if(a[i] > max) {
        max = a[i];
console.log("max number is " + max);

// 2. What's the sum of all the numbers?

var sum = 0;
for (var i = 0; i < a.length; i++) {
    sum = sum + a[i];
console.log("sum: " + sum);

// 3. Which numbers are between 50 and 100?

var numbers = [];
for (var i = 0; i < a.length; i++) {
    if (a[i] > 50 && a[i] < 100) {
console.log("numbers between 50 and 100: " + numbers);

// 4. How many numbers greater than 500?

var greaterThan500 = 0;
for (var i = 0; i < a.length; i++) {
    if (a[i] > 500) {
console.log("numbers greater than 500: " + greaterThan500);

// 5. How many even numbers?

var even = [];
for (var i = 0; i < a.length; i++) {
    if ((a[i] % 2) == 0) {
console.log("even numbers: " + even.length);

// 6. How many odd numbers?

var odd = 0;
for (var i = 0; i < a.length; i++) {
    if ((a[i] % 2) == 1) {
console.log("odd numbers: " + odd);

// 7. What's the largest even number?

var maxEven = 0;
for (var i = 0; i < a.length; i++) {
    if ((a[i] % 2) == 0) {
        if(a[i] > maxEven) {
            maxEven = a[i];
console.log("max even is " + maxEven);

// 8. How many numbers, whose sum of digits is greater than 10?

var breakApart;
var greaterThan10 = 0;
for (var i = 0; i < a.length; i++) {

    breakApart = a[i].toString()
    breakApart = breakApart.split("");
    var sumOfValue = 0;
    for (var j = 0; j < breakApart.length; j++) {
        sumOfValue += parseInt(breakApart[j]);

    if (sumOfValue > 10) {


function findSum(item) {
    var digits = item.toString();
    digits = digits.split("");

    var sumOfDigits = 0;
    function addDigits(item) {
        sumOfDigits = sumOfDigits + parseInt(item);

    if (sumOfDigits > 10) {


console.log("greater than 50: " + greaterThan10);


Below is a growing (and occasionally shrinking) list of podcasts to which I listen. Yes, to which I listen. If I'm missing any please hit me up on Twitter.

99% Invisible

The king of podcasts. In Overcast I specifically set this podcast to play at 1x because I believe every sound from Roman Mars is deliberate.

A Cast of Kings - A Game of Thrones Podcast

There are so many details in the Game of Thrones television show. I think it's important to ensure I didn't miss anything. Also it's fun to hear how the show diverges from the books.


CEOs, VCs, and engineers discuss startups, technology, and the future.

Accidental Tech Podcast

Any podcast with John Siracusa complaining is a good podcast. Marco Arment and Casey Liss join him to talk about Apple and other high-tech happenings.

Black Men Can’t Jump in Hollywood

These guys are hilarious, and they review movies starring black actors and actresses.

By The Way, In Conversation with Jeff Garlin

Jeff Garlin interviews actors and comedians. Note: Quite the unfortunate capitalization in the title.

The Canon

Movie experts discuss and argue about the best (or worst?) movies.

CreativeMornings Podcast

Inspirational talks from inspirational people. I highly recommend y'all try to visit a talk in person if CreativeMornings participates in your city.


Walt Mossberg and Nilay Patel, two curmudgeons from The Verge, discuss the latest in consumer tech.

Dan Carlin’s Hardcore History

I listened to the World War 1 series and loved it. Dan goes into great detail about global politics, weaponry, mood on the battlefield, etc. I learned so much (including how Franz Ferdinand actually died).

Design Details

Bryn Jackson and Brian Lovin chat with San Francisco designers about their backgrounds and experiences.

Design Matters with Debbie Millman: 2009-2016

Debbie Millman has honest conversations with designers and their experiences.

Extra Hot Great

Television show recaps, news, and quizzes. Can't go wrong.

The /Filmcast

Movie reviews from an entertaining bunch.

The Flop House

Comedians discuss and review bad movies, but you really listen for the ridiculous tangents.

How Did This Get Made?

This is my favorite podcast. Comedians review terrible (and awesomely terrible) movies.

I Brew My Own Coffee

Coffee nerds talk about coffee.

I Was There Too

Minor characters from important movies are interviewed.

If I Were You

I believe I've been following Jake and Amir for over ten years now. This podcast leans towards the immature side. I recommend the live shows and the episodes with guests.


Sam Soffes is great on podcasts. His "so I just did it" attitude is both entertaining and inspiring.

The Incomparable

Nerdy topics that are a bit too nerdy for me. However, they occasionally review movies and include John Siracusa. Like I said above, any podcast with Siracusa complaining is a good podcast.

The Journal by Kevin Rose

Kevin Rose discusses whatever is on his mind.


I love everything the Crew team is doing these days.

Maltin on Movies

Movie reviews from the king of movie reviews.


I don't know what it is about Don Melton. He's a unique snowflake. I'm sure he would love to hear himself described that way.

The Minimalists Podcast

Lately I've been gathering and donating old clothing and miscellaneous items. In my opinion becoming a true minimalist is like living a truly Kosher lifestyle – virtually impossible. However, I can take small steps and try.

Monday Morning Podcast

I'm a huge Bill Burr fan.

The Needle & The Mouse

Fashion meets tech meets Brooklyn meets this delightful couple. Dan Frommer and Lauren Sherman are delightful together.

The Nerdist

On average The Nerdist has entertaining guests who have made a contribution to pop culture. Occasionally there's a real gem who significantly touched your life. 

Nice To Meet You

Tobias van Schneider chats with designers.

Nothing Matters

Lauren Hockenson, my favorite local journalist, chats with her New York pal, Ben Timmins, about current affairs with a brutally honest perspective.


I've been a Paul Carr fan for years. TechCrunch, NSFWCorp, and now Pando. Sarah Lacy used to join him on the show too.

Planet Money

This podcast is similar to 99% Invisible, but with a focus on money. There's plenty of interesting stories and lessons, and some are quite funny. Did you know that some famous poker plays have stopped playing to focus on investing in other players?

The Q&A with Jeff Goldsmith

Jeff Goldsmith interviews movie directors and writers.

Real Time with Bill Maher

If you don't have access to HBO, Bill Maher's show is available as a podcast.


The iMore crew occasionally review movies.


Movie and television show reviews from the Rotten Tomatoes crew.


Season 1 was much better than season 2.

Slate’s Political Gabfest

A fun way to keep up with the election, current events, and politics.

The Spoiler Warning

Coworkers review good and bad movies.

The Talk Show With John Gruber

My favorite Apple journalist, John Gruber, discusses the latest with Apple and other tech companies.


The Incomporable crew review television shows.

Under the Radar

Marco Arment and David Smith discuss iOS development, and everything else involved with releasing an app.

Unjustly Maligned

Antony Johnston discusses movies and TV shows that weren't as bad as people think. Sometimes I actually agree with him.

The Walking Dead Podcast

A weekly review of new episodes of The Walking Dead.

We Have A Microphone

Michael and Hampton Catlin, former coworkers and current friends, discuss cocktails, travel, and whatever comes to mind.

What's Tech?

The Verge breaks down the latest in tech news into simple concepts.


Synesthesia is a neurological phenomenon in which stimulation of one sensory or cognitive pathway leads to automatic, involuntary experiences in a second sensory or cognitive pathway.

I’ve met a couple people who have Synesthesia. They claim that colors appear in their mind when they hear certain sounds (or vice versa). I reflect on this often because for most of my life I believe I suffer from a very similar phenomenon that I aptly named Cinemathesia.

Emotions experienced during a movie earlier in life can be triggered with their original potency by just a few musical notes. A great example is the movie Rudy, which arguably has one of the best original soundtracks in the history of film. A couple specific horn sounds instantly bring me back to the first time I watched the tryouts scene. I can sense the pressure Rudy is under to impress the coaches. The joy from seeing him on the Notre Dame field washes over me. I can close my eyes and feel the bass from all the times Rudy is brutally tackled.

People have always accused me of having an uncanny ability to quote movies with shocking detail. Little did they know I can also quote emotions.


I watched The Hobbit: The Battle of the Five Armies. Spoilers and thoughts below.

  • Peter Jackson: Stop the High Frame Rate nonsense. I thought you learned this lesson from the first Hobbit movie. It is frustrating to watch.
  • Gandalf: How could you make the same mistake twice? If the eagles are so badass at fighting, why don't you use them in Fellowship of the Ring? Yes, I'm aware of the "fly you fools" theory.
  • The fighting is... slow. It feels like watching a computer game in 1999. Oh except for Legolas. He's still so fun to watch.
  • Even after three movies I don't really feel a connection to the Dwarves. I know there's a fat one, an old one, a human-looking one that loves a Lost character,one that looks like Stabler from Law and Order: SVU, and the King who I'm pretty sure is related to Ed Norton Jr.
  • It is very exciting to see an army of Dwarves. Remember that in the Lord of the Rings trilogy we only see a few of them. In The Battle of the Five Armies we get to see hundreds donning iron from head to toe.
  • This movie features a level of military precision that Men do not display in the Lord of the Rings trilogy. Elves gracefully rearrange themselves while their leader rides between their ranks. Dwarves quickly construct a phalanx with their shields similar to Leonidas' first encounter with the Persian army in 300.
  • The stakes in this book/trilogy are dull. If Thorin fails then the mountain continues to belong to Smaug. Once Smaug is killed,however, the mountain is basically up for grabs. Orcs want to gain control because of the mountain's strategic location? Shrug.
  • The violence is tame. Each time an important character is killed, the camera moves to his/her face. There is one scene where I actually thought the Orc didn't kill the character.

Apple Ad

The detail in this advertisement that strikes me is when the young lady flips the switch on her aging record player which is at least forty years old. Will this be a possibility when the young lady becomes a grandmother? How will her grandchildren play her music? There will not be any physical media waiting to be discovered in a box. I suppose we hope that in her old age she still maintains a Spotify account.


Thanks to Seth Levi, I finally watched Pyscho


Some things I learned:

  • Showing a toilet on screen was extremely rare. Apparently including a toilet was more shocking than the famous shower murder scene.
  • Showing an unmarried man and woman in the same bed was very risqué at the time.
  • Hitchcock uses lingerie to depict Janet Leigh's state of mind. It's white before her decision to embezzle money, and black afterwards. Very clever.

My Pals at Hover

Earlier this month I tweeted some excitement around purchasing a ".coffee" domain name.

Magically, I received this awesome coffee grinder a few days later with a note.

Hey David. Here’s a little something to get the perfect brew while you mull over your new .coffee domain.

-Your pals at Hover

I never thought I could love a domain registrar. Hover is truly amazing.