1. string.prototype.padend
ES2017 spec-compliant String.prototype.padEnd shim.
string.prototype.padend
Package: string.prototype.padend
Created by: es-shims
Last modified: Thu, 21 Mar 2024 16:00:56 GMT
Version: 3.1.6
License: MIT
Downloads: 19,964,680
Repository: https://github.com/es-shims/String.prototype.padEnd

Install

npm install string.prototype.padend
yarn add string.prototype.padend

String.prototype.padEnd Version Badge

github actions
coverage
dependency status
dev dependency status
License
Downloads

npm badge

An ES2017 spec-compliant String.prototype.padEnd shim. Invoke its "shim" method to shim String.prototype.padEnd if it is unavailable.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Most common usage:

 var padEnd = require('string.prototype.padend');

assert(padEnd('foo', 5, 'bar') === 'fooba');

padEnd.shim();

assert(padEnd('foo', 2) === 'foo'.padEnd(2));

Tests

Simply clone the repo, npm install, and run npm test

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code