Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

normalize method javascript

// The normalize() method returns the Unicode Normalization Form of the string.

const name1 = 'u0041u006du00e9u006cu0069u0065';
const name2 = 'u0041u006du0065u0301u006cu0069u0065';

console.log(`${name1}, ${name2}`);
// expected output: "Amélie, Amélie"
console.log(name1 === name2);
// expected output: false
console.log(name1.length === name2.length);
// expected output: false

const name1NFC = name1.normalize('NFC');
const name2NFC = name2.normalize('NFC');

console.log(`${name1NFC}, ${name2NFC}`);
// expected output: "Amélie, Amélie"
console.log(name1NFC === name2NFC);
// expected output: true
console.log(name1NFC.length === name2NFC.length);
// expected output: true
Comment

PREVIOUS NEXT
Code Example
Javascript :: what is normalize in javascript 
Javascript :: firebase.database.ServerValue.TIMESTAMP 
Javascript :: repeat an element in array in js 
Javascript :: how to rotate an array in javascript 
Javascript :: for in loop key 
Javascript :: javascript date format mm/dd/yyyy 
Javascript :: how to use console.log in vuejs 
Javascript :: form submit event get button 
Javascript :: get previous year in javascript 
Javascript :: how to add checked in javascript 
Javascript :: js class exists 
Javascript :: user input in js 
Javascript :: How to add Strings as numbers in JavaScript 
Javascript :: reset page js 
Javascript :: log odd numbers js 
Javascript :: what is functional composition 
Javascript :: how to check password and confirm passwor in joi 
Javascript :: Difference in push and navigate in react Navigation 
Javascript :: js code sample 
Javascript :: require statement not part of import statement 
Javascript :: create an element jquery 
Javascript :: hide div after 5 seconds vue js 
Javascript :: api fetch in react js 
Javascript :: Map and Filter methods used together 
Javascript :: javascript get string from array with space between 
Javascript :: express redirect with post data 
Javascript :: console log return from async 
Javascript :: async javascript 
Javascript :: getting empty req.body 
Javascript :: axios httponly cookie 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =