What is short circuit evaluation?

In Javascript, logical expressions are evaluated from left to right. There are two cases we will specifically look at below:

  1. (something falsy) && (doesn’t matter)
  2. (something truthy) || (doesn’t matter)

In the first situation, this expression is read from left to right. Since the left side of the expression is false, we know that the entire statement is false, and the right side will not be read. …


One of my first coding projects ever was a CLI app that was connected to a cocktails API. As I reviewed Redux, I decided to remake that app, but this time, in REDUX. This small project was a way for me to better understand the redux cycle on a smaller scale.

Image for post
Image for post
https://dev.to/radiumsharma06/abc-of-redux-5461

A user will interact with the app in some way, like clicking a button. This will trigger an action, which is sent to the reducer, which updates the store, which contains the state, which defines the user interface(UI).

My goal was to create an app that allowed the user to click a button, and be given a random drink name and the associated photo. I began by creating the store in the index.js file. I imported Provider, which connects store and react, and imported createStore and applyMiddleware from redux. I created a store, then wrapped my App in that store. …


Can you explain what a closure is? Can you give me an example of a closure?

The short answer is: a closure is a feature in Javascript where an inner function has access to an outer function’s variables.

A closure means that an inner function has access to its own scope, then an outer function’s variables, and then global variables. The inner function remembers the environment in which it was defined. …


SQL stands for structured query language, and it is a language that manages data in a database. Many large websites have databases with a lot of user data, and SQL allows us to parse through the data to get exactly what we want.

Below, I have created a bears database in my terminal for the purposes of this blogpost. The first column of our bears database is “id INTEGER PRIMARY KEY” which designates a unique id to each bear created. Primary keys are auto incrementing and each new bear will have its own id number starting from 1. …


One of my favorite parts of building a project is designing the layout of frontend and using CSS to build a clean and user friendly site. When you talk about design and layout, you have to consider the box model. Each HTML element consists of four elements: the margins, borders, padding, and the content.

Image for post
Image for post
https://www.w3schools.com/css/css_boxmodel.asp

The innermost box is content, and the content can be text or images, and the dimensions of this box are referred to as content width and content height. The padding is a transparent area around the content. Padding is important as it gives content space from the border and helps make the page easier to look at from a user’s point of view. Imagine having a box with text on it. A box without padding would have the words right up to the edges of the content box, while a box with padding would have an invisible space around it. A border goes around the padding and the content, and the thickness of the border can be determined by border-width. You can also set a specific style and color of the border as well. The margin area is a empty area so the element is separated from neighboring elements. Dimensions of the margin can be determined by margin-box width and margin box height. …


During my module 4 project, my partner and I ran into some issues with state. Sometimes when we would make a change to state in one component, it would affect other components in a way we did not want. While we managed to make our app functional, Ruby and I felt like there might be some better way to handle state. Redux is apparently the solution.

Redux is a small library and a design pattern that can be used to manage state in React. Redux helps manage data and make state changes predictable. …


A lot of Instagram influencers are sponsored by companies to promote their products, and one way influencers connect their audience to these products is through affiliate links. An affiliate link is a specific URL that contains the ID or username of an affiliate, or the instagram influencer.

An influencer will put an affiliate link on their Instagram bio or youtube video description, and if someone clicks on that link and buys something through that link, then the blogger/influencer gets commission for the sale. One way affiliate links work is through cookies.

Image for post
Image for post

A cookie is a small piece of data in the form of text strings sent from a website and stored on the user’s computer by the user’s web browser while the user is browsing. The next time you go to that website, the website remembers you through the cookie. Influencers can create clickable links (pictures, text, etc.) that lead directly to retailers and brands they are collaborating with. These links contain tracking cookies which remains active for a certain amount of time, often 30 days. When a reader clicks that specific affiliate link and makes a purchase within the time period, both the blogger and the retailer can track that purchase and send a commission to the blogger for the lead. …


When a user creates a new account for a website, it usually asks for a name and a password with certain parameters, such as “must be between 6–20 characters.” If you put in a password that has fewer than 6 or greater than 20 characters, the website might return an error message saying “password must be between 6–20 characters” and prompt you to try again until your input matches the parameters given. When we build our own websites, we can make sure that the user inputs data the way we want it by using validations. The purpose of validations is to make sure that only valid data is saved to our database. …


My project partner and I wanted to create a bartender app that gave inexperienced alcohol drinkers the chance to explore the world beyond jello shots and frat house beer. A user would be able to input an alcohol that they liked and be given a list of cocktails and drinks with that alcohol in it. For example, if a user knew they liked gin, they would enter “gin” when prompted, and be returned a list of 40+ drinks with gin in it. The user would then type in the name of the drink that they wanted to know more about, and the program would return a list of ingredients in that drink. The user would then be able to choose whether they wanted to order that drink, or go back to the list of drinks and choose another one. When we first got our methods to work, we quickly realized that our interacting with our program felt clunky. One of the issues was that if a user misspelled the drink name, then the program would not work. …

About

Jackie Ha

Fullstack Engineer @ Forbes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store