JS array.find()

JavaScript has many array methods that can help you solve a variety of problems. One of those methods is the find() method. The find() method executes a callback function on each element in an array until it finds the first element where callback returns a true value.

Syntax

array.find(callback(element[, index[, array]])[, thisArg])

Parameters

callback

element

  • Optional

index

  • Optional

array

  • Optional

thisArg

  • Optional

Return Value

find() returns the value of the first element in the array that fulfills the provided testing function. If nothing fulfills the provided testing function, undefines is returned. Also find() does not mutate the original array.

Examples

Happy coding!

More Info!

JavaScript docs


array.slice()

JavaScript has many array methods that can help you solve a variety of problems. One of those methods is the slice() method. The slice() method returns a copy of an array that consists of elements that are selected by using two parameters. Both are optional. The slice() method also does not mutate the original array.

Syntax

array.slice([begin[, end]])

Parameters

begin


JS array.join()

JavaScript has many array methods that can help you solve a variety of problems. One of those methods is the join() method. The join() method creates and return a new string by joining all of the elements in an array.

Syntax

array.join([separator])

Parameters

separator

  • Optional

Return Value

The return value is a string with all array elements joined. If the array.length is 0, an empty string is returned. If the array contains only one element, the return value is the element without a separator.

Examples

Happy coding!

More Info!

JavaScript docs


array.includes()

JavaScript has many array methods that can help you solve a variety of problems. One of those methods is the includes() method. The includes() method determines whether an array includes a certain element, returning as a Boolean.

Syntax

array.includes(includes(findElement[, fromIndex])

Parameters

findElement
  • Required
fromIndex
  • Optional

Return Value

The return value is a Boolean, which returns true if the value of the element was found, and false if it was not found.

Things to consider

  • If the fromIndex value is negative, the search starts from the index of array.length - fromIndex by asc.
  • If fromIndex is greater than or equal to the length of the array, false is returned. The array will not be searched.

Example

Happy coding!

More Info!

JavaScript docs


JS array.filter()

JavaScript has many array methods that can help you solve a variety of problems. One of those methods is the filter() method. The filter() method creates a new array with all of the elements that pass the test implemented by the provided function.

Syntax

array.filter(function(currentValue, index, array), thisValue)

Parameters

A function to be run for each element in the array.
function(currentValue, index, array)

Function arguments:

currentValue

  • Required

Index

  • Optional

Array

  • Optional

Value


Rails API

Getting Started

Using Rails as your API(Application Programming Interface) is a very popular choice. Rails provides a set of defaults that allows developers to get their app up and running quickly. To get started, run the following command:

rails new my_api --api -T

This will generate a new project. The API argument tells Rails that we are building an API application. The -T removes the default testing framework if you want to add a different one such as RSpec.

Rack CORS

In order to make cross-origin AJAX calls possible, we need to uncomment the following gem in the GemFile.

#Use Rack CORS for handling…


Ruby on Rails is a perfect framework for building websites, and it is designed keeping the best programming practices in mind. It is wonderful to use as an API, but it doesn't render very nicely. To render Rails in a prettier way, it is best to use a serializer such as Active Model Serializer, which is especially useful when you only want to display certain attributes.

The first step is to add the following to your Gemfile:

gem ‘active_model_serializers’

then you want to run bundle install.

bundle install

The next step is to generate a serializer for a specific model…


So, you graduated from a software engineering boot camp and don’t really know what to do next. I completely understand because I was in your shoes very recently. Hopefully this will help you know what to focus on next. I included many links to amazing articles that helped me.

Coding is Fun!

Algorithms and Data Structures

These are very important to focus on next. You will be solving algos in technical interviews and they are essential in your future software engineering career. The main once to focus on are:

With a focus on:

Cat Whitmer

I am a Full Stack software engineer that enjoys problem solving and can't wait to learn more. Hard work and dedication shape my work ethic.

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