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.
array.find(callback(element[, index[, array]])[, thisArg])
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.
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.
slicestarts removing from index
join() method. The
join() method creates and return a new string by joining all of the elements in an array.
separatoris a string used to separate each pair of adjacent elements of the array. If excluded, the array elements are separated with a comma (“,”). If the
separatoris an empty string, all elements are joined without any characters in between them.
The return value is a string with all array elements joined. If the
0, an empty string is returned. If the array contains only one element, the return value is the element without a
includes() method. The
includes() method determines whether an array includes a certain element, returning as a Boolean.
The return value is a Boolean, which returns true if the value of the element was found, and false if it was not found.
fromIndexvalue is negative, the search starts from the index of
array.length - fromIndexby asc.
fromIndexis greater than or equal to the length of the array,
falseis returned. The array will not be searched.
filter() method. The
filter() method creates a new array with all of the elements that pass the test implemented by the provided function.
array.filter(function(currentValue, index, array), thisValue)
A function to be run for each element in the array.
function(currentValue, index, array)
thiswhen executing a…
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.
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:
then you want to run 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.
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:
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.