当前位置:网站首页>JS -- first understand the naming rules and data types of JS and variables
JS -- first understand the naming rules and data types of JS and variables
2022-07-27 02:09:00 【Bonsoir777】
Preface
From today on, I will open a new JS series , And will continue to update , If it can help you a little bit in front of the screen , I will be very happy ~( In this paper, Js Variables section in )
One 、 What is? JS?
- JS(JavaScript)
A scripting language originally developed by Netscape ,
- JS Component part
- ECMAScript
It defines the basic syntax and basic objects of the script language , Now every browser has low ECMAScript The implementation of the
2.DOM(Document Object Model)
Document object model , In the browser DOM Solidify the whole web page into a tree structured document composed of node levels ,3
3.BOM(Broswer Object MOdel)
Browser object model , Describes the method and interface of accessing and operating the browser window .
- JS Basic usage
1. Inline : take js The code is written directly inside the label
<a href="javascript:alert(' Click on me ');"> You order me too </a>
2. embedded : take JS The code is written in script In the label , Written in head Medium or body in
3. Outer chain : take script The label is written in an external file ,script Once the label is introduced outside js file , You can't write code anymore , You need to recreate a script Tags are used to write internal code , for example :
,<script src="./01.js"></script>
Two 、 Variable
1. Declaration of variables
- Use var Keyword declared variables , Will be declared before all code is executed ( But no assignment )
- But if you don't use var keyword , Then the variable will not be declared in advance ,
var a=123;
2. Identifier naming rules
- It can contain letters , Numbers , Underline ,$
- Cannot start with a number
- It can't be ES Keywords or reserved words in
- Generally, hump is named ( Initial lowercase , Capitalize the beginning of each word , The rest of the letters are lowercase xxxZzzYyy)
3. data type
var obj3 = new Object( );var obj4 = new Object( );
3.1 character string string
- Use quotation marks to express as a string
- Single quotation marks , And double quotation marks cannot be mixed
- Quotation marks cannot be nested , Double quotation marks can't be put in double quotation marks , You can't put a single quote
- have access to \ Character escape
- \'' Express ''
- \' Express '
- \n Means line break
- \t Generate tabs , It's equivalent to pressing once tab key
- \\ Express \
3.2 The number number
3.3 Boolean value
summary
That's what I want to share today , Beginners JS Are some basic grammatical parts , But it is the foundation of future learning , Beginners of front-end students must take it seriously . Finally, I still see your peace and happiness in front of this screen , Health and happiness , Wish you and me ~
边栏推荐
- Hash索引和B+树相关知识
- 6.30滴滴面经(一面+二面)
- mysql视图
- Enumerated valueof() method stepping on the pit
- JS 99 multiplication table
- DF-GAN实验复现——复现DFGAN详细步骤 及使用MobaXtem实现远程端口到本机端口的转发查看Tensorboard
- Autojs learning - realize image cutting
- Merge sort (recursive and non recursive writing)
- Share 29 chrome plug-ins, and there is always one for you
- 平面转换(位移、旋转、缩放)
猜你喜欢

Flink1.13.6 detailed deployment method

left join 、inner join 、right join区别

MVCC及其原理详解

Introduction to network - Introduction to Enterprise Networking & basic knowledge of network

MySQL索引
![[详解C语言]一文带你玩转函数](/img/44/53cdac9b9cf0d3f77e5da05956c3dc.png)
[详解C语言]一文带你玩转函数

GAN的训练技巧:炼丹师养成计划 ——生成式对抗网络训练、调参和改进

Docker advanced: detailed explanation of MySQL master-slave replication and redis cluster capacity expansion and reduction configuration cases

Pseudo class of a element

ERROR! MySQL is not running, but PID file exists
随机推荐
Electron FAQ 61 - must the client run with administrator privileges?
MySQL index
7.16 多益网络笔试
24ssh service
【数据库课程设计】SQLServer数据库课程设计(学生宿舍管理),课设报告+源码+数据库关系图
解决方案:炼丹师养成计划 Pytorch+DeepLearning遇见的各种报错与踩坑避坑记录(二)
The gradient descent method and Newton method are used to calculate the open radical
shell课程总结
(atcoder contest 144) f - fork in the road (probability DP)
引用的通俗讲解
GAN的训练技巧:炼丹师养成计划 ——生成式对抗网络训练、调参和改进
R分数复现 R-precision评估指标定量 文本生成图像R分数定量实验全流程复现(R-precision)定量评价实验踩坑避坑流程
分库与分表
科学计算库 —— Numpy
25pxe efficient batch network installation
7.13 蔚来提前批笔试
Pseudo class of a element
力扣获取第二大的成绩
Codeforce problem 908 D. new year and arbitrary arrangement (probability DP)
How does MySQL get the first three items in each group