T7.1: What is an array? - p5.js Tutorial

Views 33 145 482 8

Published on Oct 02, 2015

This video covers the basics on using arrays in JavaScript. What do they look like, how do they work, when should you use them?

Next video: https://youtu.be/RXWO3mFuW-I?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

Support this channel on Patreon: https://patreon.com/codingtrain

Contact: https://twitter.com/shiffman

Send me your questions and coding challenges!: https://github.com/CodingTrain/Rainbow-Topics

Link to code on Github: https://github.com/CodingTrain/Rainbow-Code

p5.js: http://p5js.org

For More p5.js Videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

Help us caption & translate this video!


Categoy: Education

p5.js array arrays javascript (programming language) array data structure programming language (software genre) what is an array javascript p5.js array p5.js tutorial p5.js arrays what is an array? what is array daniel shiffman arrays what is an array? - p5.js tuorial what is an array js programming creative coding p5js p5.js tutorials

  • Mridula Ekka - 4 days ago

    What an awesome energy you have

  • krane rcc - 3 weeks ago

    "whiteboard talks to me"

  • Protegit - 2 months ago

    Can I put images into an array?

  • Sadaiha Johnson - 4 months ago

    This is a great videos

  • Tushar Goyal - 4 months ago

    hey words.leng/words.length doesn't seem to be working. has keyword been updated to something else? like println() is now just 'print()'

  • Jessica Becker - 4 months ago

    You have taught me so much about coding. We use your videos in school and outside of school.

  • Ritik Khatri - 5 months ago

    I am studying C++ in school, the syntax for defining functions, array are totally different in javascirpt. I hope I don't get confused b/w Js and C++.

  • Akhilesh Naduvath - 6 months ago

    Man u r the teacher i have ever had.I understand this so quickly and i'm 15.keep up the good work.It's really helping me and i'm pretty sure it does to all. :)

  • Oki Virgiawan - 7 months ago

    Do you make android studio tutorial too ?

  • Baraa Safaa - 9 months ago

    @Daniel, you are indeed a great teacher and very passionate. I am reaching a challenging thing here with this code below: The issue is that: 1) I am adding the commands to print the ellipse on the screen. For some reason, once the text was rendered on screen, the ellipse disappeared and also the text is being rendered in a very weird way. 2) I am trying to display a text on screen stating that the "list has ended" before I set the index=0. Can you please help me here? Thanks, baraa var index=0; var nums = [100,12,55,-6,77]; var words = ['love', 'baraa', 'linah', 'cat', "5",6,78] var num = 25; function setup() { createCanvas(600,400); } function draw() { background('black'); //ellipse stroke('white'); noFill(); strokeWeight(3); ellipse(150,350,40,40); fill('white') textSize(24); text(words[index],12,200); } function mousePressed(){ index+=1; if(index==words.length){ fill('red'); text('this is the end of array!',50,100); index=0; } }

  • VeganCartel - 9 months ago

    You're like the Bob Ross of programming

  • kartikey srivastava - 9 months ago

    Hey, how did you create the blue magical mass in real time? Thank you for sharing this stuff, means a lot to us. Exceptional as always :)

  • Marthy Manuel - 10 months ago

    I have watched your video since I have watch your flappy bird challenge. I like the way you so informative and enjoyable. Keep it up. Hoping to see more videos. What is the software you use for p5? where can I get it? Thank you!

  • Faboch - 10 months ago

    What is your code editor?

  • ssrh suresh - 11 months ago

    I like your explanation

  • Bradley Stone - 11 months ago

    When you counted to 9 on your fingers...

  • Topsoil Depletion Awareness (closing the loop) - 11 months ago

    How do you do Math.floor in p5 so I can do something like Math.floor(random(0,4))?

  • Dũng Tấn - 12 months ago

    Which editor do you use?

  • Jamelle messinger - 12 months ago

    Has anyone figured out how to use the random function with this set up to choose the words at random? For some reason I can't seem to figure this challenge out..hmm

  • Stephen Lai - 12 months ago

    I like this tutorial

  • Jamie Bergmann - 1 year ago

    I am struggling so hard with my intro to comsci course and these are so helpful. also you are hilarious without meaning to be, makes the videos a lot more enjoyable to watch aha

  • Xavier Gregorio - 1 year ago

    words.length doesn't work!?

  • Billy Rogers - 1 year ago

    big ups

  • Benjamin Whateley - 1 year ago

    "I don't ever see love because I stop myself at 4" soml.

  • Ritesh Srivastav - 1 year ago

    You start from the basics and make it hell of a lot more interesting on the way to the End!!

  • MajestatiXx - 1 year ago

    U are doing such a grat job :) I am really enjoying ur videos and programming with JavaScript. Im not good at it, but i see some progress :D

  • Luís Vieira - 2 years ago

    Dear Daniel, in the first array of the example at 8:30, you have var nuts = [100, 25, 46, 72], but shouldn't it be from the bigger value to the lower one? Like [100, 72, 46, 25]? Or that order is not relevant?

  • Phurbos - 2 years ago

    I literally put the same thing you wrote and mine doesn't work. Why is that? javascript

  • msnicoleleeee314 - 2 years ago

    Thank you very much! Your channel is my final's savior !