OrgPad logo

Coding for dumME

Created by Baruš Jeřábková

Notes from the Grasshopper app Notes from Hello Ruby book for kids Looking for answers Embracing "shit happens" reality Just trying to get it....

#beginner, #beginners, #code, #coding, #dummies, #grasshopper, #javascript, #js, #programming, #self-taught

Coding for dumME

getting a specific iten from an array - changing the index

IMG 20201228 125134

Array [ ]

list of items

The item can be different data types: numbers, strings, oter arrays

An array inside another array is called an array nestingIMG 20201228 120913

Screenshot 2020-12-28-12-19-07-789 com.area120.grasshopper

function picking up from an array

IMG 20201228 121317

Variable var

They allow you to reference the same piece of information multiple times. 

In JS can be defined using var then giving the variable a unique nameIMG 20201228 104113

Screenshot 2020-12-28-10-45-47-397 com.area120.grasshopper

Function ( )

tells a computer to do a certain thing

functions can take arguments to give the computer extra information

example:

in Grasshopper - drawBox ()

Argument

in Grasshopper drawBox(red) - red is an argument, tells the computer to draw a red box

String ' '

Letters, words, and sentences are called strings in coding. 

Quotation marks are used to show the start and the end of a string.

for example 'hello world' is a string 

console.log('I will be able to code for real!')

Pick random color - two functions

IMG 20201228 112859

value

IMG 20201228 120427

storing data and changing the value =

IMG 20201228 112747

Screenshot 2020-12-28-11-51-21-188 com.area120.grasshopper

Screenshot 2020-12-28-11-58-37-544 com.area120.grasshopper

new line

Screenshot 2020-12-28-10-32-23-839 com.area120.grasshopper

if statement - if ( ) { }

If statements allow you t orun a specific section of code when a test is true.

The code inside ( ) is the test

 If the test is true then the code inside the block { } runs. If the test isn't true, the code in the block doesn't run.

IMG 20201228 130141

IMG 20201228 134321

equality operator ===

inequality operator !==