From 0081fc3f93cc1369f030c6fbc64c812f641470d5 Mon Sep 17 00:00:00 2001 From: starclee Date: Tue, 17 Jun 2025 00:57:35 +0530 Subject: [PATCH] Add Str fromCodePoint.md file --- .../terms/fromCodePoint/fromCodePoint.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 content/javascript/concepts/strings/terms/fromCodePoint/fromCodePoint.md diff --git a/content/javascript/concepts/strings/terms/fromCodePoint/fromCodePoint.md b/content/javascript/concepts/strings/terms/fromCodePoint/fromCodePoint.md new file mode 100644 index 00000000000..415bbd7c622 --- /dev/null +++ b/content/javascript/concepts/strings/terms/fromCodePoint/fromCodePoint.md @@ -0,0 +1,45 @@ +--- +Title: 'String.fromCodePoint()' +Description: 'Returns a string created by using the specified sequence of Unicode code points.' +Subjects: + - 'Web Development' + - 'Computer Science' +Tags: + - 'Strings' + - 'Unicode' + - 'Methods' + - 'JavaScript' +CatalogContent: + - 'introduction-to-javascript' + - 'paths/front-end-engineer-career-path' +--- + +# String.fromCodePoint() + +The `String.fromCodePoint()` method returns a string created by using the specified sequence of Unicode code points. It allows for the creation of characters from their Unicode values, including characters beyond the Basic Multilingual Plane (code points greater than 0xFFFF). + +## Syntax + +```javascript +String.fromCodePoint(num1, ..., numN) +``` + +- **num1, ..., numN**: One or more code points. +- **Returns**: A string created from the specified code points. + +## Example + +```javascript +console.log(String.fromCodePoint(9731, 9733, 9842, 0x2F804)); +// Output: ☃★♲你 +``` + +## Codebyte + +```codebyte/javascript +const greeting = String.fromCodePoint(128075); +console.log(greeting); // 👋 + +const emojis = String.fromCodePoint(128514, 128513, 128523); +console.log(emojis); // 😂😁😋 +```