Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
SIPL
(view source)
Revision as of 16:18, 4 February 2020
340 bytes added
,
16:18, 4 February 2020
→Example
Line 16:
Line 16:
==Example==
==Example==
−
'''var''' words = ~["hello", " ", "world"];
''
//Create an array
''
+
'''var''' words = ~[
<span style="color:blue">
"hello"
</span>
,
<span style="color:blue
"
>
"
"</span>
,
<span style="color:blue">
"world"
</span>
];
<span style="color:green">
//Create an array
</span>
−
'''if''' (5 < 10 < 20)
''
//Always true
''
+
'''if''' (
<span style="color:blue">
5<
/span> < <span style="color:blue">
10<
/span> < <span style="color:blue">
20
</span>
)
<span style="color:green">
//Always true
</span>
{
{
−
'''var''' result = "";
+
'''var''' result
= <span style
="
color:blue
"
>""</span>
;
'''foreach''' (word '''in''' words)
'''foreach''' (word '''in''' words)
{
{
−
result = result + word;
''
//Concatenate the strings from the array
''
+
result = result + word;
<span style="color:green">
//Concatenate the strings from the array
</span>
}
}
−
Debug(result);
''
//Log the result
''
+
Debug(result);
<span style="color:green">
//Log the result
</span>
}
}
Khornel
Bureaucrats
,
Interface administrators
,
Administrators
768
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version