r35
r1
1[[분류:테스트]][[분류:나무마크 문법]]
2[[../|상위 문서]]
r3
3[[../include 결과|결과 보기]]
r1
4== 변수 a=1 ==
r35
5 * 기본형식 : a==1
r34
6{{{#!wiki style="word-break: keep-all;"
r28
7||<table bgcolor=transparent,transparent> 구분 || a= || +a= || -a= || 'a'= || "a"= || \[a\]= [* if 조건문을 \[a\]==1 식으로 걸어놓음.] || \[a=\][* if 조건문을 \[a==1\] 식으로 걸어놓음.] || calc(a)= || calc(+a)= || calc[a]= || calc[+a]= || calc['a']= || @@_@a@= ||
8|| ==1[* 단, -a= 열에는 if 조건문을 -a==-1 으로 걸어놓음.] || {{{#!if a==1
9출력}}} || {{{#!if +a==1
10출력}}} || {{{#!if -a==-1
11출력}}} || {{{#!if 'a'==1
12출력}}} || {{{#!if "a"==1
13출력}}} || {{{#!if [a]==1
14출력}}} || {{{#!if [a==1]
15출력}}} || {{{#!if calc(a)==1
16출력}}} || {{{#!if calc(+a)==1
17출력}}} || {{{#!if calc[a]==1
18출력}}} || {{{#!if calc[+a]==1
19출력}}} || {{{#!if calc['a']==1
20출력}}} || {{{#!if @a@==1
21출력}}} ||
22|| =='1' || {{{#!if a=='1'
23출력}}} || {{{#!if +a=='1'
24출력}}} || {{{#!if -a=='1'
25출력}}} || {{{#!if 'a'=='1'
26출력}}} || {{{#!if "a"=='1'
27출력}}} || {{{#!if [a]=='1'
28출력}}} || {{{#!if [a=='1']
29출력}}} || {{{#!if calc(a)=='1'
30출력}}} || {{{#!if calc(+a)=='1'
31출력}}} || {{{#!if calc[a]=='1'
32출력}}} || {{{#!if calc[+a]=='1'
33출력}}} || {{{#!if calc['a']=='1'
34출력}}} || {{{#!if @a@=='1'
35출력}}} ||
36|| =="1" || {{{#!if a=="1"
37출력}}} || {{{#!if +a=="1"
38출력}}} || {{{#!if -a=="1"
39출력}}} || {{{#!if 'a'=="1"
40출력}}} || {{{#!if "a"=="1"
41출력}}} || {{{#!if [a]=="1"
42출력}}} || {{{#!if [a=="1"]
43출력}}} || {{{#!if calc(a)=="1"
44출력}}} || {{{#!if calc(+a)=="1"
45출력}}} || {{{#!if calc[a]=="1"
46출력}}} || {{{#!if calc[+a]=="1"
47출력}}} || {{{#!if calc['a']=="1"
48출력}}} || {{{#!if @a@=="1"
49출력}}} ||
50|| ==\\1 || {{{#!if a==\1
51출력}}} || {{{#!if +a==\1
52출력}}} || {{{#!if -a==\1
53출력}}} || {{{#!if 'a'==\1
54출력}}} || {{{#!if "a"==\1
55출력}}} || {{{#!if [a]==\1
56출력}}} || {{{#!if [a==\1]
57출력}}} || {{{#!if calc(a)==\1
58출력}}} || {{{#!if calc(+a)==\1
59출력}}} || {{{#!if calc[a]==\1
60출력}}} || {{{#!if calc[+a]==\1
61출력}}} || {{{#!if calc['a']==\1
62출력}}} || {{{#!if @a@==\1
63출력}}} ||
r34
64}}}
r4
65
r35
66== 변수 this.a=1 ==
67기준모양 : this.a == 1
68||<table bgcolor=transparent,transparent> 구분 || this.a || +this.a || -this.a || "this.a" || [this.a] || this['a'] || this["a"] || this[+a] || this[a] || +this['a'] || +this["a"] ||
69|| ==1[* 단, -this.a 에는 -this.a==-1로 걸어놓음.] || {{{#!if this.a==1
70출력}}} || {{{#!if +this.a==1
71출력}}} || {{{#!if -this.a==-1
72출력}}} || {{{#!if "this.a"==1
73출력}}} || {{{#!if [this.a]==1
74출력}}} || {{{#!if this['a']==1
75출력}}} || {{{#!if this["a"]==1
76출력}}} || {{{#!if this[+a]==1
77출력}}} || {{{#!if this[a]==1
78출력}}} || {{{#!if +this['a']==1
79출력}}} || {{{#!if +this["a"]==1
r28
80출력}}} ||
r35
81|| =='1' || {{{#!if this.a=='1'
82출력}}} || {{{#!if +this.a=='1'
83출력}}} || {{{#!if -this.a=='1'
84출력}}} || {{{#!if "this.a"=='1'
85출력}}} || {{{#!if [this.a]=='1'
86출력}}} || {{{#!if this['a']=='1'
87출력}}} || {{{#!if this["a"]=='1'
88출력}}} || {{{#!if this[+a]=='1'
89출력}}} || {{{#!if this[a]=='1'
90출력}}} || {{{#!if +this['a']=='1'
91출력}}} || {{{#!if +this["a"]=='1'
r28
92출력}}} ||
r35
93|| =="1" || {{{#!if this.a=="1"
94출력}}} || {{{#!if +this.a=="1"
95출력}}} || {{{#!if -this.a=="1"
96출력}}} || {{{#!if "this.a"=="1"
97출력}}} || {{{#!if [this.a]=="1"
98출력}}} || {{{#!if this['a']=="1"
99출력}}} || {{{#!if this["a"]=="1"
100출력}}} || {{{#!if this[+a]=="1"
101출력}}} || {{{#!if this[a]=="1"
102출력}}} || {{{#!if +this['a']=="1"
103출력}}} || {{{#!if +this["a"]=="1"
104출력}}} ||
105위의 표는 {{{#!wiki style="display: inline; font-family: monospace;"
106this}}} 함수 안에 {{{#!wiki style="display: inline; font-family: monospace;"
107{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}}}} 를 포함하여 {{{this}}} 함수 안에 다른 모양을 넣고 테스트를 해보는 표이다.
108{{{#!wiki style="display: inline; font-family: monospace;"
109this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}과, {{{#!wiki style="display: inline; font-family: monospace;"
110this\[{{{#green 변수명}}}\]}}}도 지원되는지 테스트, this{{{#orange .}}}{{{#green 변수명}}}이 텍스트값으로만 될 수 있는지 테스트.
r4
111
r35
112 * {{{#orange 결론 1 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
113this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}(큰따옴표)은 {{{#!wiki style="display: inline; font-family: monospace;"
114this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}(작은따옴표)와 마찬가지로 텍스트 값으로 출력된다.
115 * {{{#orange 결론 2 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
116this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}, {{{#!wiki style="display: inline; font-family: monospace;"
117this\[{{{#green 변수명}}}\]}}}은 실수값으로도 텍스트 값으로도 계산하기에는 올바른 입력이 아니다.
118 {{{#!wiki style="display: inline; font-family: monospace;"
119this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}를 숫자 값으로 나오게 하고 싶으면 {{{#!wiki style="display: inline; font-family: monospace;"
120{{{#orangered +}}}this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}이나 {{{#!wiki style="display: inline; font-family: monospace;"
121{{{#orangered +}}}this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}} 등 알맞게 입력해야 한다.
122 * {{{#orange 결론 3 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
123this{{{#orange .}}}{{{#green 변수명}}}}}}은 양식만 잘 맞추면 숫자값으로 또는 텍스트값으로 나오게 할 수 있다.
124
125== 변수 a=b, b=1 테스트 ==
126변수 하나를 다른 변수의 포인터(point)로 두고 테스트.
127{{{#!folding [펼치기 · 접기]
128{{{-5 {{{-3 [include(문테스트:If문법/include 대상, a=b, b=1 )]}}}}}}}}}
129
r28
130== 변수 c\= ==
r29
131null과 "" 이 어떤 조건에서 되는지 테스트.
132||<table bgcolor=transparent,transparent> 구분 ||<width=20%> {{{#blue c==null}}} ||<width=20%> {{{#orange c==""}}} ||<width=20%> c=={{{#gray ''(space)''}}} ||<width=20%> c="{{{#gray ''(space)''}}}" ||
133|| 출력테스트 || {{{#!if c==null
134출력}}} || {{{#!if c==""
135출력}}} || {{{#!if c==
136출력}}} || {{{#!if c==" "
r28
137출력}}} ||
r8
138
r18
139== this 함수 ==
r29
140===# this \[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\] 관련 테스트 #===
r8
141this['true']=true 테스트
142{{{#!if this['true']==true
143출력 }}}
144----
r32
145this['a'] == null 테스트
146{{{#!if this['a'] == null
147출력}}}
148----
r15
149a=b 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다.
r9
150{{{#!if a==b
r8
151출력}}}
152----
r32
153this['a']=this['b'] 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다.
r8
154{{{#!if this['a']==this['b']
155출력}}}
r9
156----
r22
157a+b=c 테스트 (먼저 숫자로 출력되는 변수들끼리 덧셈식이 올바르게 작동하는지를 검증하기 위한 테스트이다.)
r9
158{{{#!if a+b==c
159출력}}}
160----
161this['a']+this['b']=this['c'] 테스트
162{{{#!if this['a']+this['b']==this['c']
r11
163출력}}}
164----
r15
165+a+b=+c 테스트 : 아무 변수도 호출하지 않으면 nullnull == null 형식이 되는 것으로 추정된다.
r11
166{{{#!if +a+b==+c
167출력}}}
168----
r15
169(+a)+(+b)=+c 테스트 : 숫자값으로 연산하고자 +를 선언했으므로 괄호로 엮어야 한다.
r14
170{{{#!if (+a)+(+b)==+c
171출력}}}
172----
r16
173+this['a']+this['b']=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
r11
174{{{#!if +this['a']+this['b']==+this['c']
r16
175출력}}}
r18
176----
r16
177(+this['a'])+(+this['b'])=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
r33
178{{{#!if (+this['a'])+(+this['b'])==+this['c']
r18
179출력}}}
180
r24
181{{{#orange 결론 : }}} {{{#!wiki style="display: inline; font-family: monospace;"
r25
182this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}는 텍스트 값으로 출력된다.
r26
183