A step-by-step guide on how to publish a npm package

Build amazing things with npm

In this blog post, I will show you how easy it is to publish your own npm package in the world’s largest software registry. For this tutorial, I created a dummy file that we will publish together.

Everything you need to know about implicit type coercion to ace your technical interview

A dog looking at the Ipad’s screen
Photo by Cookie the Pom on Unsplash

What do you know about implicit type coercion in JavaScript? This question often comes up during the technical interview for a junior developer role. If you don’t know the answer or you’ve never heard this term before, they might rephrase: “What will JavaScript output if you try to sum up 2 and ‘2' ?”

No need to guess here and say that JavaScript sometimes may output unpredictable results. Though it really might! If you’re curious about unpredictable results, watch this amazing video by Brian Leroux:

The question you are being asked is a very reasonable question and you need…

Creator: Grafner | Credit: Getty Images/iStockphoto | Copyright: Grafner

A callback function in JavaScript is a function that is called after another function has finished executing.

Since JavaScript uses an event-driven programming model, it does not wait for a function to finish its execution, it moves on to the next one immediately. Callbacks make it possible for you to set a function to execute only after another function has finished executing.

Functions in JavaScript are first-class objects, meaning that they can be assigned to variables, passed as a function argument, or can be assigned as a return value of another function. Any function that is passed as an argument…

What do you think when you hear the word “algorithm”? It’s a word that is impossible to avoid in our modern world, but few people really know what it means.

It is in fact a rather vague term, usually, it means a sequence of actions where the main goal is to solve a problem. Do you know how to bake a cake, how to cross a road, or how to find the book you’re looking for in Barnes & Noble? Those are algorithms. But in the programming world, we are talking about a different kind of algorithm. Why is it…

A short guide for decreasing web page load time

Photo by Steven Lelham on Unsplash

Did you know that web page load time can affect your website’s search engine ranking? This is super obvious, in a time when everyone is in hurry, nobody wants to wait for your page to load. 1 of 4 users will abandon a page if the site doesn’t load in 4 seconds. That is why Google included page load speed as a ranking factor for desktop and mobile searches.

Of course there are many factors that influence your website’s ranking position, but speed is an important one and should be seriously considered if you want your users to move past…

Many of you are already familiar with hooks in React that let us use state and lifecycle methods in functional components. In this blog post I want to look in more detail at the useState hook. (By the way, if you are interested in why you should switch to functional components in React check out my blog post here).

Photo by Timothy Dykes on Unsplash

Why do we need the useState hook? Before hooks were introduced in 2018 we could use state only in class components, updating it in the setState method. For a long time functional components couldn’t manage state on their own and were…

Using PayPal sandbox to create a fast and safe checkout option in your React based e-commerce platform

Integrating a shopping cart into your project? Chances are you want to use PayPal for an easy checkout option. People feel much safer making purchases on a website with a PayPal checkout option. In this blog post I’m going to walk you through setting up and testing a PayPal sandbox account.

Credit card and padlock on laptop keyboard with buy button and shopping cart icon
Creator: Advantus Media Inc. and QuoteInspector.com | Credit: QuoteInspector.com

PayPal offers a sandbox account for developers to use to implement and test PayPal checkout on their websites before going live. You can test your application and mimic live transactions by using personal and business emails provided to you by PayPal.

To start, you must set up your development…

AJAX guide for beginners

In this blog post I want to walk you through the basics of AJAX and show you some simple examples to help you get started.

Photo by Greg Rakozy on Unsplash

AJAX stands for Asynchronous JavaScript And XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with servers. In more simple words, AJAX is a technique for accessing web servers from a web page. AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of the web page without reloading the whole page.


A mini- guide to web accessibility

Image from https://uxplanet.org/web-accessibility-explained-c2408636eee0

In this blog post I want to talk about web accessibility. I’m going to look into what web accessibility is, why it is so important, what groups of people need to be considered when building your app/website and how to implement accessibility into your project.

So, what is web accessibility? Accessibility is the practice of making your website usable by as many people as possible (MDN).

It is important to understand that in order to make an accessible website or app, we need to think not only of people with physical disabilities but also of people using devices with limited…

Switch to functional components with hooks instead

Once I learnt how to write functional components in React using hooks I was amazed by how much faster and cleaner it was; there is no way I’m going back to class components! I decided to look deeper into why functional components are preferable and if there is any advantage to using functional components over class components.

Image from https://www.dasithsblog.com/blog/react_hooks/

Let’s start with why React decided to stop using classes.

First of all, classes gradually become unreadable if they store different logic in one place as they grow. For example in componentDidMount() you can place a fetch request, you can set the style for an element, or connect to the WebSocket. All of…

Margarita Morozova

@FlatironSchool alumna

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