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

Detailed explanation of JS variable naming convention

零下一度
零下一度Original
2017-07-02 09:29:451290browse
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!

Statement:
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