- Building Web and Mobile ArcGIS Server Applications with JavaScript(Second Edition)
- Eric Pimpler Mark Lewin
- 137字
- 2021-07-02 15:48:54
Decision support statements
An if/else statement in JavaScript and other programming languages is a control statement that allows for decision-making in your code. This type of statement performs a test based on an expression, that you specify at the top of the statement. If the test returns a value of true then the statements associated with the if block will run. If the test returns a value of false then the execution skips to the first else if block. This pattern continues until a value of true is returned in the test or the execution reaches the else statement. The following code example shows how this statement works:
var layerName = 'streets'; if (layerName == 'aerial') { alert("An aerial map"); } else if (layerName == "hybrid") { alert("A hybrid map"); } else { alert("A street map"); }
推薦閱讀
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- PyTorch自動駕駛視覺感知算法實戰
- 深入淺出Spring Boot 2.x
- Vue.js快跑:構建觸手可及的高性能Web應用
- Mastering QGIS
- HTML5+CSS3基礎開發教程(第2版)
- 精通搜索分析
- The Computer Vision Workshop
- Java性能權威指南(第2版)
- 微信公眾平臺開發:從零基礎到ThinkPHP5高性能框架實踐
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- 從零開始學C#
- LabVIEW虛擬儀器入門與測控應用100例
- AngularJS UI Development
- 大話程序員:從入門到優秀全攻略