From b979a446c755453bb4b06ecb8b80150bf8a44e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20de=20Courville?= Date: Tue, 26 Mar 2024 20:02:14 +0100 Subject: [PATCH] Fixed backticks in inline code in Librairie tutorial --- contributor_docs/creating_libraries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributor_docs/creating_libraries.md b/contributor_docs/creating_libraries.md index f1ae76c982..28f1de9607 100644 --- a/contributor_docs/creating_libraries.md +++ b/contributor_docs/creating_libraries.md @@ -212,7 +212,7 @@ Note two things from the code above: 1. We call the `p5.prototype.registerPreloadMethod()` function passing in the name of the `loadCSV()` function as a string as the first parameter and `p5.prototype` as the second parameter. 2. At the end of `fetch()`, after the CSV data has been parsed and pushed into the result array, `this._decrementPreload()` function is called. 3) Now, if you test your sketch again, you should see that the “`myCSV`” variable is populated with the data from the CSV file! -4. Note that due to inherent limitations of this technique, the returned “`result`” variable must be an object (array is also a type of object in Javascript) and must not be overwritten in the function body. You can set properties of the object (or push to the array), but you cannot reassign the variable (i.e., you cannot do “`result = data.split(‘\n’)`”). +4. Note that due to inherent limitations of this technique, the returned “`result`” variable must be an object (array is also a type of object in Javascript) and must not be overwritten in the function body. You can set properties of the object (or push to the array), but you cannot reassign the variable (i.e., you cannot do “``result = data.split(`\n`)``”).
Quite a bit of magic is happening here: firstly, why does “`result`” now contain the additional data when `fetch()` should still have been asynchronous and thus running after “`result`” has returned?