Home > Web Front-end > Front-end Q&A > What is camel case naming in javascript

What is camel case naming in javascript

WBOY
Release: 2022-06-22 15:25:44
Original
2900 people have browsed it

In JavaScript, camel case naming refers to when a variable name or function name is a unique identifier composed of one or more words connected together, the first letter starts with a lowercase letter, and the first letter starts with a lowercase letter. The first letter of each word after the beginning of the second word is capitalized; for example, "myFirstName".

What is camel case naming in javascript

The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.

What is camel case naming in JavaScript

JavaScript generally uses camel case naming.

Camel-style nomenclature is when a variable name or function name is a unique identifier composed of one or more words connected together. The first word starts with a lowercase letter; starting with the second word The first letter of each word after the beginning is capitalized.

For example: myFirstName, myLastName, such variable names look like camel humps rising one after another, hence the name.

What is camel case naming in javascript

What is camel case naming in javascript

What is camel case naming in javascript

What is camel case naming in javascript

#From this, some attributes can also use camel case naming, such as font-size, font-weight, etc., which can be written as fontSize, fontWeight.

Note that in the code snippet shown above, you can write style.fontSize, style['font-size'], style['fontSize'], but writing

style.font-size will cause an error .

【Related recommendations:

javascript video tutorial, web front-end

The above is the detailed content of What is camel case naming in javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template