- Lua Quick Start Guide
- Gabor Szauer
- 108字
- 2021-08-05 10:30:36
nil
A nil value represents the absence of data. If you try to access a variable that has not been created yet, its value will be nil. If you are done using a variable, you should assign it to be nil. This code first prints nil because nothing is assigned to the variable foo. Then, the string bar is assigned, and after this the code prints bar. Finally, nil is assigned back to the variable. The last time the variable is printed, it will print nil again:
print (foo) -- will print: nil
foo = "bar"
print (foo) -- will print: bar
foo = nil
print (foo) -- will print: nil
推薦閱讀
- Vue.js快速入門與深入實戰
- DevOps Automation Cookbook
- ANSYS Fluent 二次開發指南
- 計算機應用基礎案例教程
- Elasticsearch Essentials
- RubyMotion iOS Develoment Essentials
- Tableau Desktop可視化高級應用
- Java 9 with JShell
- C/C++代碼調試的藝術(第2版)
- 一步一步學Spring Boot:微服務項目實戰(第2版)
- Python程序員面試算法寶典
- Mastering Wireless Penetration Testing for Highly Secured Environments
- LabVIEW案例實戰
- Mastering Puppet(Second Edition)
- Drupal 8 Quick Start Guide