-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,002 changed files
with
55,995 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
layout: '@layouts/reference/SingleReferenceLayout.astro' | ||
title: stringify | ||
module: Foundation | ||
submodule: Foundation | ||
file: src/core/reference.js | ||
description: > | ||
<p>From <a | ||
href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify">the | ||
MDN entry</a>: | ||
The JSON.stringify() method converts a JavaScript object or value to a JSON <a | ||
href="#/p5/string">string</a>.</p> | ||
line: 490 | ||
params: | ||
- name: object | ||
description: | | ||
<p>:Javascript object that you would like to convert to JSON</p> | ||
type: Object | ||
itemtype: method | ||
class: JSON | ||
example: | ||
- |- | ||
<div class='norender'> | ||
<code> | ||
let myObject = { x: 5, y: 6 }; | ||
let myObjectAsString = JSON.stringify(myObject); | ||
console.log(myObjectAsString); // prints "{"x":5,"y":6}" to the console | ||
console.log(typeof myObjectAsString); // prints 'string' to the console | ||
</code> | ||
</div> | ||
alt: This example does not render anything | ||
chainable: false | ||
--- | ||
|
||
|
||
# stringify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
layout: '@layouts/reference/SingleReferenceLayout.astro' | ||
title: log | ||
module: Foundation | ||
submodule: Foundation | ||
file: src/core/reference.js | ||
description: > | ||
<p>Prints a message to your browser's web console. When using p5, you can use | ||
<a href="#/p5/print">print</a> | ||
and <a href="#/p5/console/log">console.log</a> interchangeably.</p> | ||
<p>The console is opened differently depending on which browser you are using. | ||
Here are links on how to open the console in <a | ||
href="https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console">Firefox</a> | ||
, <a | ||
href="https://developers.google.com/web/tools/chrome-devtools/open">Chrome</a>, | ||
<a | ||
href="https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide/console">Edge</a>, | ||
and <a | ||
href="https://support.apple.com/en-ca/guide/safari/sfri20948/mac">Safari</a>. | ||
With the <a href="https://editor.p5js.org/">online p5 editor</a> the console | ||
is embedded directly in the page underneath the code editor.</p> | ||
<p>From <a | ||
href="https://developer.mozilla.org/en-US/docs/Web/API/Console/log">the MDN | ||
entry</a>: | ||
The Console method log() outputs a message to the web console. The message may | ||
be a single <a href="#/p5/string">string</a> (with optional substitution | ||
values), | ||
or it may be any one or more JavaScript <a href="#/p5/object">objects</a>.</p> | ||
line: 512 | ||
params: | ||
- name: message | ||
description: | | ||
<p>:Message that you would like to print to the console</p> | ||
type: String|Expression|Object | ||
itemtype: method | ||
class: console | ||
example: | ||
- |- | ||
<div class='norender'> | ||
<code> | ||
let myNum = 5; | ||
console.log(myNum); // prints 5 to the console | ||
console.log(myNum + 12); // prints 17 to the console | ||
</code> | ||
</div> | ||
alt: This example does not render anything | ||
chainable: false | ||
--- | ||
|
||
|
||
# log |
Oops, something went wrong.