Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Commonmark migration
Source Link

Details are in the source in the comments.

###SNIPPET

SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<output id="msg"></output>

Details are in the source in the comments.

###SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<output id="msg"></output>

Details are in the source in the comments.

SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<output id="msg"></output>

The console is now officially available.
Source Link
Jed Fox
  • 3k
  • 5
  • 31
  • 38

Details are in the source in the comments.

###SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<!-- Results pane console output; see http://meta.stackexchange.com/a/242491 -->
<script src="http://gh-canon.github.io/stack-snippet-console/console.min.js"></script>
<output id="msg"></output>

Details are in the source in the comments.

###SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<!-- Results pane console output; see http://meta.stackexchange.com/a/242491 -->
<script src="http://gh-canon.github.io/stack-snippet-console/console.min.js"></script>
<output id="msg"></output>

Details are in the source in the comments.

###SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<output id="msg"></output>

Source Link
zer00ne
  • 45.3k
  • 6
  • 50
  • 82

Details are in the source in the comments.

###SNIPPET

/*
Global variable: intro
*/
var intro = 'My name is ';
/*
Paramenter: who
*/
function updateMsg(who) {
 /* 
 Array of 2 Strings: guess 
 Named it guess because that's
 what I ended up doing with it
 */
 var guess = [' Shadey', ' Joseph'];
 /*
 Concated String: `hello`
 Since `intro` is global it's always accessible
 `who` is the parameter with value of "Slim"
 `guess[0]` = 'Shadey'
 */
 var hello = intro + who + guess[0];
 /*
 Output of `updateMsg()` function is `hello`
 which is "My name is Slim Shadey"
 */
 return hello;
}
/*
Reference the `output` element as `noLogic`
*/
var noLogic = document.getElementById("msg");
/*
Set `noLogic's` text to whatever `updateMsg()`
returns
`updateMsg()` parameter is "Slim"
*/
noLogic.textContent = updateMsg("Slim");
<!-- Results pane console output; see http://meta.stackexchange.com/a/242491 -->
<script src="http://gh-canon.github.io/stack-snippet-console/console.min.js"></script>
<output id="msg"></output>

lang-js

AltStyle によって変換されたページ (->オリジナル) /