11 Concepts That Will Level Up Your JavaScript Skills As a Junior Developer


The trim() method removes whitespace from both sides of a string.

var str = “ Hello World! “;


The slice() method extracts parts of a string and returns the extracted parts in a new string.

let str = ‘The morning is upon us.’
str.slice(-3) // returns ‘us.’
str.slice(-3, -1) // returns ‘us’
str.slice(0, -1) // returns ‘The morning is upon us’


This function converts a string Character to Lowercase Character.

const sentence = ‘The quick brown fox jumps over the lazy dog.’;
// expected output: “the quick brown fox jumps over the lazy dog.”


Split a string into an array of substrings:

var str = “How are you doing today?”;
var res = str.split(“ “);


function converts a string to a floating number.

parseFloat(51.12) //51.12


This example returns a random integer between the specified values. The value is no lower than min (or the next integer greater than min if min isn't an integer), and is less than (but not equal to) max.


The math round function returns the value of a number rounded to the nearest integer.

// expected output: 1

console.log(Math.round(5.95), Math.round(5.5), Math.round(5.05));
// expected output: 6 6 5

console.log(Math.round(-5.05), Math.round(-5.5), Math.round(-5.95));
// expected output: -5 -5 -6


8.Array.filter() :

when you working with data,u will must need to filter dta.Array.filter do the task for u.

function isBigEnough(value) {
return value >= 10

let filtered = [12, 5, 8, 130, 44].filter(isBigEnough)

The following example returns all prime numbers in the array:


The find method returns the value of the first element in the provided array that satisfies the provided testing function.

Find an object in an array by one of its properties

const array1 = [5, 12, 8, 130, 44];

const found = array1.find(element => element > 10);

// expected output: 12


Don’t be thrown off by JavaScript parameter destructuring! It’s a common way to cleanly extract properties from objects.


Array.reduce method call a reducer function and return a single accumulated value to get an array where duplicate items have been removed.



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
Nadim Mahmud

Nadim Mahmud


My name is Nadim Mahmud. I am a software developer with extensive knowledge in programming, web development, mobile development, and database design.