Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 1.35 KB

File metadata and controls

59 lines (48 loc) · 1.35 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
charCodeAt Method (String) (JavaScript) | Microsoft Docs
01/18/2017
windows-client-threshold
devlang-javascript
language-reference
charCodeAt
JavaScript
TypeScript
DHTML
charCodeAt method
5b0290a7-ee4d-4738-a909-c02ef64a2f1a
12
mikejo5000
mikejo
ghogen

charCodeAt Method (String) (JavaScript)

Returns the Unicode value of the character at the specified location.

Syntax

  
strObj. charCodeAt(index)  

Parameters

strObj
Required. Any String object or string literal.

index
Required. The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.

Remarks

Example

The following example illustrates the use of the charCodeAt method.

var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";   
document.write(str.charCodeAt(str.length - 1));  
  
// Output: 90   

Requirements

[!INCLUDEjsv55]

See Also

String.fromCharCode Function