Javascript In-Built Methods

Javascript In-Built Methods

Working with JavaScript this keyword can be tricky. In the past few years, JavaScript has come out with many new built-in methods and functions which have made JavaScript more readable, efficient and use way less code. I am going to go over some of these ready-made methods that I find myself using time and time again to manipulate data.

In the past few years, JavaScript has come out with many new built-in methods and functions which have made JavaScript more readable, efficient and use way less code. I am going to go over some of these ready-made methods that I find myself using time and time again to manipulate data.


String Methods

In JavaScript, a string stores a series of characters/text inside double or single quotes. For the following methods, let's go with the classic example string,const str = "Hello World!"to demonstrate.

str.concat()

This method joins the text of 2 strings and returns a new string:

let secondString = "!!"
str.concat(secondString) //=> "Hello World!!!"

str.repeat()

The clue is in the name, it allows you to repeat a string!

str.repeat(3) //=> "Hello World!Hello World!Hello World!"

str.split()

Splits a string into an array of substrings by the separator you decide. In the first instance, I will separate the string by character. In the second instance, I will separate the string by space!

str.split('') //=> ["H", "e", "l", "l", "o", " ", "W", "o", "r", "l", "d", "!"]

str.split(' ') //=> ["Wello", "World!"]

str.toLowerCase()

Converts the string to lowercase.

javascript-tips javascript javascript-development

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

Developer Career Path: To Become a Team Lead or Stay a Developer?

For a developer, becoming a team leader can be a trap or open up opportunities for creating software. Two years ago, when I was a developer, ... by Oleg Sklyarov, Fullstack Developer at Skyeng company

6 Ways to Practice Your Coding Skills and Grow Your Career as a JavaScript Developer

6 min read ... Some of the highest-paid JavaScript developers make close to $500k/year ... actually need to learn many languages in the course of their career to ... Learn concepts professional developers need to advance their careers ...

The essential JavaScript concepts that you should understand

The essential JavaScript concepts that you should understand - For successful developing and to pass a work interview

Hire Best JavaScript Developers | JavaScript development company USA

Hire Dedicated JavaScript Developers from a top javascript development agency for your business solutions. We provide JS web developers for hire at a fixed or hourly rate.