The drag and drop is one the most basic and important actions a person learns when they are first introduced to a computer with a GUI (Graphical User Interface). The first time I remember performing the action is back on my PC running Windows 95 when I dragged a file over my Trash Bin Icon and dropped it in, effectively deleting the file.
The premise has not changed much since then. At its base simplicity, the steps are as follows:
How to chain methods in JS in order to write concise and readable code.
Very often when programming, you will have the need to transform a piece of data many times in a row in order to get it to your desired final state. Each of these transformations will be carried out by a specific function/method, and will need to be done in a certain order.
When reading code, generally you read top to bottom, left to right. So if you saw a bit of code that looks like this, your instinct would be to read it like so:
myObject.method1() <-- read this first
myObject.method2() <-- read this next
The idea to write this blog came out during my Mod2 Project at Flatiron School, during which my Partner Austin Buhler and I decided to create a Fantasy Football Lineup Optimizer. We built a large pool of NFL Players, and very quickly I realized we had a need to sort and filter this table by multiple attributes, as well as search the table for certain values. Unfortunately, I had no idea how to do this. So began my dive into the world of Tables, HTML, and Rails.
We’ll start by defining our table of NFL Players. Each player has a name attributes, position attribute, and an aggregate ranking. …
Your comprehensive guide to Pry and how to use it .
Every programmer has faced a situation where they go to execute their code and get an error message they’re confused by, or even worse, the code runs successfully but nothing is output. This was me, and before I learned about Pry I would do things like combing through my code, line by line, trying to guess where the error could be. I even had a phase of inserting puts statements (puts “The error is here!”) hoping to figure out where the error was originating from. Once I learned about Pry, I never looked back. …