当前位置:网站首页>JS syntax usage
JS syntax usage
2022-08-05 08:21:00 【Eight ~ male】
JS output statement
alert('value') The browser pops up an alert box
console.log('value') browser console printout information
prompt('info') The browser pops up an input box, and the user enters
Variables in JS
1.1 What is a variable
A variable is a fast space allocated by a program in memory to store data.
The use of variables is divided into two parts: 1. Declaration of variables 2. Assignment
declare a variable
var age; //declare a variable named age
var is the js keyword, used to declare variables (meaning variable variables).After you declare a variable with a keyword, the computer automatically allocates space for the variable.
age: is the variable name defined by the programmer, and we allocate space through the variable name.
Variable assignment aeg=18
Output: console.log(age); or alert(age)
Declaring a variable without assignment will report undefined.
Using a variable without declaring or assigning a value will report an error: tel is not defined
js can be used without declaring variables and assigning them directly.
js data type
Data types are divided into simple and complex types
Simple data types (Number, string, Boolean, Undefined,null)
Complex data type (object)
Simple Data Type Description
Simple Data Types , Description , Default
Number Numeric, including integer and floating point 0
Boolean Boolean type true false Equivalent to 1 and 0 false
String
Undefined var a The declared variable is not assigned a value at this time a=undefined undefined
Null var=null declares that the variable a is empty
边栏推荐
- TensorFlow installation steps
- SQL语句查询字段内重复内容,并按重复次数加序号
- DataFrame insert row and column at specified position
- 数据源对象管理Druid和c3p0
- Moonbeam团队发布针对整数截断漏洞的紧急安全修复
- 【结构体内功修炼】结构体内存对齐(一)
- EA谈单机游戏:仍是产品组合中极其重要的部分
- 在ASP控制数字及字母输入
- NC20164 :最大数MAXNUMBER [线段树]
- How to replace colors in ps, self-study ps software photoshop2022, replace one color of a picture in ps with another color
猜你喜欢

嵌入式系统:基本定时器

v-if/v-else determines whether to display according to the calculation
![[Structure internal power practice] Structure memory alignment (1)](/img/31/4ddc16810da8238ac95a93d007e12e.png)
[Structure internal power practice] Structure memory alignment (1)

The Coolest Kubernetes Network Solution Cilium Getting Started Tutorial

How to make pictures clear in ps, self-study ps software photoshop2022, simple and fast use ps to make photos clearer and more textured

Chapter 12 Bayesian Networks

Ethernet Principle

TensorFlow安装步骤

力扣刷题八月第一天

ps怎么把图片变清晰,自学ps软件photoshop2022,简单快速用ps让照片更清晰更有质感
随机推荐
Luogu P4588: [TJOI2018]数学计算
Nn. Unfold and nn. The fold
DPU — 功能特性 — 存储系统的硬件卸载
Three solutions to solve cross-domain in egg framework
routing----router
JS语法使用
v-if/v-else determines whether to display according to the calculation
How to make a puzzle in PS, self-study PS software photoshop2022, PS make a puzzle effect
青苹果论坛重新开放
k-nearest neighbor fault monitoring based on multi-block information extraction and Mahalanobis distance
spark集群部署(第三弹)
Basic introduction of stack and queue and C language implementation of functions such as creation, destruction, entry and exit, counting the number of elements, viewing elements, etc., as well as stac
Version number naming convention
Detailed explanation of DNS query principle
RedisTemplate: error template not initialized; call afterPropertiesSet() before using it
TensorFlow安装步骤
请问my sql如何把两个表的内容集合在一起啊?
C语言制作-QQ聊天室
Insights in programming
DataFrame在指定位置插入行和列