Home > Web Front-end > JS Tutorial > Detailed explanation of JS variable naming convention

Detailed explanation of JS variable naming convention

零下一度
Release: 2017-07-02 09:29:45
Original
1369 people have browsed it
lNaming convention and necessity

lReadability——can understand

l##Normative——Conform to the rules

##l Hungarian nomenclature

##lType prefix

## typePrefix

type

Example

##Array

a

Array

##aItems

Boolean value

b

##Boolean

bIsComplete

##Floating point number

f

Float

##fPrice

##Function

fn

Function

fnHandler

Integer

i

##Integer

##iItemCount

##Object

o

Object

##oDiv1

#Regular expression

##re

RegExp

reEmailCheck

String

s

##String

##sUserName

##Variant variable

v

Variant

##vAnything

#lFirst letter capitalized

The above is the detailed content of Detailed explanation of JS variable naming convention. 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