< Back
Page 3 of 3
This chapter is from the book
Summary
Conditional processing is essential in the development of ColdFusion applications, and several tools are available to help you use it. <cfif> is often the best tool, but <cfswitch> is easier to read and performs better under certain circumstances.
Sample Questions
- Which operators are used to test for equality? (select two)
- ==
- IS THE SAME AS
- IS
- =
- EQ
- Which of the following is logically equivalent to TRUE?
(select all that apply)
- -1
- ON
- 1
- YES
- What output would the following code generate?
<cfset name="Ben"> <cfswitch expression="name"> <cfcase value="Ben"> Hello Ben. </cfcase> <cfcase value="Angela"> Hello Angela. </cfcase> <cfcase value="Jeff"> Hello Jeff. </cfcase> <cfdefaultcase> I have no idea who you are. </cfdefaultcase> </cfswitch>
- Hello Ben.
- Hello Angela.
- Hello Jeff.
- I have no idea who you are.
< Back
Page 3 of 3