Well, first of all, it is not a function. According to MDN documentation, Math is is a built-in object that has properties and methods for mathematical constants and functions. It works with the Number data type and allows you to perform a vast range of mathematical tasks.
In this blog, I’ll make a top 8 of the most common and useful Math functions.
1.Math.round(x) — returns the value of x rounded to its nearest integer:
Math.round(7.7); // returns 8
Math.round(7.3); // returns 7
2. Math.pow(x, y) returns the value of x to the…
Sunday is for coding: today I was working on a reverse integer algorithm!
Leetcode marked it as an easy one, however, it took me some time to get it. There are tons of ways to solve this problem, and this one might be a little clumsy so feel free to refactor it! Also, one of my goals was to practice the Math and Number methods that I haven’t implemented for a while.
So, our task is:
Given a signed 32-bit integer
xwith its digits reversed. …
When it comes to working in tech, your first guess is: well, that’s all about web development! It might be quite right but personally, I consider this as a sort of a dangerous misconception. Clearly, full-stack, front- and backend web development is one of the most well-known and popular career paths in the field of tech. But in fact, there are tons of other options!
Why this misconception is dangerous? Well, because you might push yourself into the position that is not the right fit for you. Also, while looking for a job, it’s smart to check all the options…
Dashing through Leetcode problems, I found this one: Linked List Cycle. In this blog, I’ll solve it using the two-pointer approach.
Our task is to determine if the linked list has a cycle in it. Return true if there is a cycle in the linked list. Otherwise, return false.
What is considered to be a cycle? There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Have a look at this example.
While working on group projects, it is truly vital to organize your workflow consistently and productively. You can use a spreadsheet, which works well for smaller projects. But what if you’re building something more complicated, with a bigger team involved? You can definitely use a database, but it might be too time-consuming and also require some SQL knowledge.
That’s where project planners and organizers come into play.
The market offers tons of different options. For our current project, my partner suggested that we use Airtable and I found this one pretty intuitive and easy to implement.
Airtable is a cloud-based…
Recently, while working my way through this tutorial, I came across a React library called prop-types. I’ve never used this library before, so I made a quick research on why we need prop-types and how to use is.
As your app…
I think we all can agree on this: Two-Sum Algorithm is sort of a classic data structure challenge. In my blog, I’d like to share two approaches to solving it. The first one is a so-called “brute force” method, and the second one represents a more elegant solution
So, our problem is: Given an array of numbers and a target number, find the sum of two numbers from the array that is equal to the target number. May not sum the same index twice. Return these numbers.
Here, I’m using…
Solving a palindrome algorithm is one of the most common data structure tasks during a technical interview. In this blog, I’m going to break down one of those algorithms and share with you my method of solving it. It might be not the smartest and the most efficient way, so feel free to come up with any other!
First things first: what is a palindrome? It is a sequence of characters that reads the same backward or forward. Our task is to find out whether a given string is a palindrome. Return true if the given string is a palindrome…
The MDN documentation says that: