Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

normalize 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

normalize js

<script>
var a = "Geeks For Geeks";
 
b = a.normalize('NFC')
c = a.normalize('NFD')
d = a.normalize('NFKC')
e = a.normalize('NFKD')
     
document.write(b,c,d,e);
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to access the GET parameters after “?” in Express 
Javascript :: oneerror javascript image 
Javascript :: mongoose unique validator 
Javascript :: String.toLower() js 
Javascript :: math.min 
Javascript :: how to use the replace method in javascript 
Javascript :: mongoose put request 
Javascript :: delete component angular 
Javascript :: js create array with default value 
Javascript :: js sort number array 
Javascript :: promise.race 
Javascript :: sorting in javascript 
Javascript :: add toaster in angular 
Javascript :: No provider for ReducerManager 
Javascript :: assign array to another array javascript 
Javascript :: input type email react js-validation 
Javascript :: uncaught (in promise): both the table and dtoptions cannot be empty 
Javascript :: repeat an array multiple times in js 
Javascript :: react native float upto 2 digits 
Javascript :: react native safeareaview 
Javascript :: jquery get all input name and values and submit 
Javascript :: regex must match exactly 
Javascript :: remove repetition multidimensional array javascript 
Javascript :: new Date() get speicifc hours min sec 
Javascript :: javascript copy div element content 
Javascript :: cors in node js 
Javascript :: why does my form reload the page? html js 
Javascript :: find my url in nodejs 
Javascript :: javascript count character in string 
Javascript :: debouncing javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =