#3 How Does a Non-Developer Learn to Write Developer Documentation? Let’s Find Out! (JavaScript Mnemonics Examples...)

I‘m a copywriter who writes content for the general public, but I want to become a technical writer who writes documentation specifically for software developers. This is my educational journey…

Casey Armstrong
The Documentarian Planetarium
3 min readFeb 7, 2018

--

https://www.pexels.com/photo/couch-conference-concentration-startup-7111/

In Post #2 Mnemonics and JavaScript, I explained my struggle with learning JavaScript on FreeCode Camp.

(Currently, I have completed all the JS exercises up to the ‘counting cards’ exercise, https://www.freecodecamp.org/map.)

In this post, I will explain a few mnemonics I used to better internalize a few quirks of this programming language that I was having trouble with:

Push

.push() takes one or more parameters and “pushes” them onto the end of the array. var arr = [1,2,3];

arr.push(4);

// arr is now [1,2,3,4]

I was having trouble remembering the order of the elements and what push did. So, I drew this image and wrote this sentence:

A manta ray standing on a frisbee pushes a beach ball to the end of the line…

arr.push()

For the other elements similar to Pop, I kept the main scenario and made sentences that helped me remember what they did:

Pop

Sometimes when the manta ray pushes the beach ball, it pops it and then it’s gone…

arr.pop()

Shift

Shifty manta rays are the first in line to pop the beachball…

arr.shift()

Unshift

Un-shifty manta rays don’t pop the beach ball. They are the first in line to add one…arr.unshift()

I made this sentence to remember acceding numbers in arrays means starting with zero and to use brackets.

Bracket notation

Mr. bracket was the first in line to buy the jacket, but he had zero dollars.

(use bracket notation to signify order in an array, but it starts at zero, not one)

In the End

In the end, memorizing these mnemonics helped me get past moments of disorientation and focus on writing the code required for the exercises. They were a great-great help. I can see as I move forward, I’ll have to make many-many more in order to feel like I’m programming instead of swimming in code soup.

Below you can see a function that, thanks to mnemonics, I can understand without referencing anything. In short, it pushes a value to the end of the array, and it removes an item from the beginning.

https://www.freecodecamp.org/map

Output: Before: [1,2,3,4,5]

1

After:[2,3,4,5,6]

--

--

Casey Armstrong
The Documentarian Planetarium

Technical Writer obsessed with #API’s, #VR, #Chatbots, #Crowdsourcing, #Microvolunteering, #PortableHomelessShelters, and the future!!