?
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Twitter • RESTEP © Year • Terms
Home
  ·  
July 2021
2019
2020
2021
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
DEC
  ·  
Filters
LatestTrendingFollowingRuns
DesignWorkflowsDevelopmentAutomation
Libraries
Community
Dashboard
Profile
Library
Recourse
Restep
Story
Remaker
Restep Creator
Recourse Creator

Welcome to Restep

Thanks for joining. Please take a quick tour...

Make & Learn Automagically

Say goodbye to watching tutorials and following walkthroughs. Restep repeats the clicks and key strokes of talented makers on your device.

Discover Recourses

Learn from the best click-by-click and take your no-code game to the next level, starting with Webflow. More platforms are on the way!

Teach Like Never Before

Use the Restep Creator to share your workflows with the world. But first, experience Restep by selecting one of the Recourses below...
200K
Recourses
10m
Resteps
30+
Remakers
$60k
Earned
90k
Shares
1m
Runs
Rebuild Civilization VI
Webflow • 18 Resteps
Photomasking Effect
Webflow • 4k Runs
Before/After Preview Effect
Webflow • 3.5k Runs
Dynamic Switches
Webflow • 1.7k Runs
Apple TV Weather Card
Webflow • 2.4k Runs
Create a Rotating Orbit
Webflow • 906 Runs
Adalo Library opens in March
Adalo makes creating apps as easy as putting together a slide deck. Turn your idea into a real native app — no code needed! Drag and drop expert-designed components.
Remind MeDon't Remind Me
FollowUnfollow
Recourses
Webflow

Webflow empowers web designers to build professional, responsive, and custom websites in a visual canvas with no code. Use promo code RESTEP for 50% off.

FollowUnfollow
Recourses
Memberstack

Memberstack is what the Webflow community needs. A membership backend app that can be easily integrated into any Webflow project with just a line of code.

Bring Your Platform to Restep
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Nelson
@ThePixelGeek
San Francisco • Joined Nov 2021
Dad to a Glowing star. Husband to @Jraecruz. Sr. Product Evangelist @Webflow. Helping others 'make the web beautiful together' - http://youtube.com/pixelgeek
FollowUnfollow
Share
6k
Remakers
3k
Comments
25k
Bookmarks
800
Hired
500
Recourses
11k
Resteps
1k Followers • 10 Recourses
Dan Parry @Dan
2k Followers • 20 Recourses
Lacey Kesler @Lacey
3k Followers • 30 Recourses
Joe Krug @Joe
Updates
Settings
Billing
$4,567
Earned this Month
60k
Runs
2k
Shares
+37
Followers
-6
Followers
5k
Bookmarks
Daily Challenge
Test your Airtable skills
Adalo Library has been opened
12:05 • App Development • 100 Recourses
@ThePixelGeek published a Webflow Recourse
11:40 • Advanced Components and Interactions
@Joseph added "3D Experiences" to his Recourse
11:25 • Award-Winning Webflow Animations
@Andre followed you from Greece
10:58 • 3 Recourses
Yesterday
@Thanos published a Blog
13:00 • Best Javascript Practices
@Shiku bookmarked "Webflow Workflows"
12:07 • They have bookmarked your work eight times in the past
New Milestone... 100K Remakers!
11:46 • This is our sixth milestone
September 21
Introducing Profiles
17:12 • Monetize your recourses
Restep 2.0 has been released
16:17 • New modes, updated design, and more...
@WillOdia joined the Restep Team
13:19 • Meet our new Frontend Developer from Nigeria
Weekly Report
13:03 • 10k Runs, 20 Shares, 5 Followers
Go Premium
Unlock our libraries, receive exclusive content, experience new modes, and get early access to upcoming features.
Activate
Account
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Receive Messages From
Anyone
Remakers I Follow
Nobody
Connect
Twitter
Apple
Google
Sign Out
Delete Account
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Save
Recourse
Upload Cover
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Pricing

Free
Dropdown
$10$50$100$150
Unlock Custom Pricing

Visibility

Public
Private
PublishDelete
Restep
Upload Cover
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Visibility

Private
Public
PublishDelete
Chapter
PublishDelete
Chapter 1
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
2 Steps
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Step 1
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Type or Select a Function
Add a SectionAdd a Div BlockChange Font Color
Target an Element
Add a SectionAdd a Div BlockChange Font Color
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Step 2
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Type or Select a Function
Add a SectionAdd a Div BlockChange Font Color
Target an Element
Add a SectionAdd a Div BlockChange Font Color
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Webflow
Webflow empowers web designers to build professional, responsive, and custom websites in a completely visual canvas with no code.
FollowUnfollow
Share
798
Recourses
900
Resteps
180
Remakers
150k
Runs
Mitsos
@Karavias
Greece · Joined Sep 2020
Bootstrapping the best learning experience!
ShareEdit Profile
SaveCancel
0
Resteps
#100
Rank
7.8k
Followers
98
Following
Create a Recourse
Start sharing your knowledge...
Animation and Design
Webflow • 3 Resteps
Mitsos · Webflow · Sep 2021
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Pricing
Free$10$30$50
$100
PublishSave DraftDelete
Upload Thumbnail
300x180 | 2MB Max
Intro Video
Optional
Add a Restep
Every journey begins with a restep ;)
Attorney Template
Webflow • 0 Runs
Mitsos · Webflow · Sep 2021
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
PublishSave DraftDelete
Upload Thumbnail
300x180 | 2MB Max
Intro Video
Optional
Chapter 1  ·  
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Select Body
Body
Go to Style Panel
Elements Panel
Style Panel
Interaction Panel
Settings Panel
Assets Panel
Size
Position
Display
Borders
Effects
Width
Height
Min Width
Min Height
Max Width
Max Height
Set Width
To 
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Select Body
Body
Add ChapterTest Run
Sako  ·  Webflow...  ·  Sep 2021
Introduction to Webflow
Feel intimidated? Not sure where to start? Then this recourse is perfect for you. It guides you through all the basics you need to master Webflow and more...
Get for $49Start
Share
3
Resteps
6k
Runs
5.0
Rating
#20
Rank
Introduction to Webflow
Webflow • 300 Runs
Structuring a Webflow Website
Webflow • 500 Runs
Creating Interactions
Webflow • 1k Runs
Sako • Webflow • Sep 2021
Introduction to Webflow
Let's start by mastering the user interface.
Run ItTeach Me
Share
200
100
300
400
580
Steps
4k
Runs
5.0
Rating
#9
Rank
Chapter 1 - Create Your Style Guide
An optional description about this chapter.
1
Step Name
An optional description about this step.
2
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
3
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
4
Step Name
An optional description about this step.
5
Step Name
An optional description about this step.
Chapter 2 - Set Up Webflow
An optional description about this chapter.
1
Step Name
An optional description about this step.
2
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
3
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
4
Step Name
An optional description about this step.
5
Step Name
An optional description about this step.
Chapter 3 - Design Your Page
An optional description about this chapter.
1
Step Name
An optional description about this step.
2
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
3
Step Name
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
4
Step Name
An optional description about this step.
5
Step Name
An optional description about this step.
Would you recommend my restep?
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you, I appreciate it.
Mitsos • Just Now
This is the best introduction to Webflow interactions.
Erin • 10:34
Amazing work, you're a great teacher.
Mitsos • 10:40
Thanks a lot, glad you enjoyed this restep :)

Best Javascript Practices

Thanos • September 23

So, you have a handle on writing JavaScript, but how do you go from practice to real problem solutions? How do you alter your JS code to make it simpler and easier to read? If you work on a team, it’s important to write simple code. Since you’re not working in a vacuum, your programs must be easy to follow by your team members. Everyone loves clean code! Learning how to make JavaScript as painless as possible is an invaluable skill sure to make you an office favorite. Today, we’ll go over 15 best practice tips to help simplify your JavaScript and make it easily understandable by other developers.

‍

1. Declare and initialize your variables at the top

Nothing disrupts readability like a late declaration. Just as it’s easier to take out all your tools before starting a job, it’s simpler to declare all variables before getting into the nitty-gritty of your function. This gives easy access should we need to tweak any name or value later down the line. While on the topic of variables, it’s best practice to initialize your variables at the time of creation so you and your team can ensure none are left undefined.

‍

2. Build modular, specialized function

No one function should have to do it all, for both efficiency and readability’s sake. Instead, when designing functions, consider a single task that it should accomplish and write it to complete that task only. Name the function to match that task.

This makes the code easier for others to read. The function will inherently be simpler and less extensive if only working toward one task. Further, it allows you and your team to lift this function to another program should you need it later. Even with just the passed variable names and function titles, we get a clearer understanding of where to find certain tasks in the second version below.

‍

3. Recognize and remove duplicate code

Similar to our last example, you should look out for instances in your code where you have identical lines of duplicate code. In cases like these, you should move the duplicated code into a function and call the function in all the instances that it was used before. This reduces visual clutter and aids in debugging later as the team can look at the one function rather than its multiple usage sections.

‍

4. Comment your code often

Comments are a great way to summarize a code fragment’s purpose, saving your fellow developers the time it would take to determine it on their own. It also allows them to catch possible mistakes if the code does not complete the task it is commented to complete. In general, it’s best to leave one comment on every function. If you’re unsure if you should leave a comment, just do it! It can always be deleted later if it’s too much clutter.

‍

5. Beware of recursion overuse

Be mindful of nesting recursive functions too many levels. While capable of solving many problems, nesting is notoriously difficult to understand at a glance.

To avoid confusion, be mindful of where recursive functions can be pulled out of their nested place without significant runtime cost and do so whenever possible. If you have 3+ levels of nested functions, chances are your fellow developers will have a hard time following it.

‍

6. Be efficient with DOM manipulations

Accessing the DOM is essential for getting the most out of your program, but doing so repeatedly causes visual clutter and will slow down the program. Instead, access it once and cache it for later use in a variable. From then on, you can access that variable instead of the DOM directly. This process is cleaner and more efficient.

‍

7. Avoid global variables at all costs

In JavaScript, variables have a scope in which they can be used, either global or local. These scopes decide where in your code these variables are defined or can be accessed. Global variables can be defined anywhere in the program and exist outside of functions. Local variables are only visible within the function it is defined.

If there are a local variable and a global variable with the same name, JavaScript will prioritize the local variable and ignore the global variable. Global variables should still be avoided, as they can accidentally overwrite window variables resulting in errors. Further, having many global variables will slow down your program since they are not deleted until the window is closed, whereas local variables are deleted once the function is completed.

‍

8. Make use of shorthand notation (Object Literals)

When designing objects or arrays in JavaScript, line space can be saved by opting for shorthand notation. This is accomplished by setting the properties or cells of an object or array during declaration rather than after. This saves you having to identify which object or array you’re setting for on each line, making the section easier to read. While this may seem like a small change, it can save a lot of eye strain for your team as the objects and arrays get more complex.

‍

9. Use Strict Mode to catch silent errors

JavaScript is a very forgiving language compared to other hardcoded languages like C++ and Java. While helpful for getting code to run without throwing errors, this leniency can lead to silent errors that pass without correction. This can also lead to inconsistent behavior if JavaScript can resolve the silent error in multiple ways.

To bypass this, opt into Strict Mode. This setting makes two major changes:

  • Silent errors that would previously make it past the compiler now throw errors, allowing you to fine-tune your code before it reaches your team members.
  • Fixes mistakes that prevent JavaScript from optimizing your code
  • JavaScript Strict Code programs often run faster than their “sloppy” counterparts

To opt into strict mode, add the line'use strict'; either at the top of your script section (if you want the whole section to be strict) or before the desired function (if only certain sections should be strict).

‍

10. Set default values

When creating objects, you can set default values for some or all properties of the object. Doing so ensures the values of each attribute are not undefined. It also demonstrates what type of data is expected for that attribute. Additionally, by not setting default values for certain properties, you can communicate to your team that those values are not required for the object to function correctly.

Above, not all properties will have a unit number, but all will have the other four properties, which are populated with the data type expected. To demonstrate this, we leave unit blank.

‍

11. Use template literals to combine strings

Putting strings together is a pain, especially when combining strings and variables. To make this process simpler, you can use template literals (marked by backticks), which take both a string and variable.

‍

12. Solve existence testing with includes

Testing the existence of a value within an array is a common problem. Thankfully, JavaScript comes with a special array method, includes(), which will return a Boolean if the array contains the searched value. Rather than searching the array, this method provides an efficient, easy-to-read solution.

‍

13. Shorten conditionals with falsy values

In JavaScript, there are many values that are equivalent to false across multiple types of variables. This includes:

  • the Boolean false
  • null
  • 0
  • NaN (not a number)
  • ' '
  • " "

In JavaScript, equivalent == means that the two objects share the same values, but they may not be the same type. Identical === means that the two objects are both the same type and same value. But how is this useful?

Well, instead of creating separate variables to hold Booleans, you can instead use the above as default values to report false if nothing overwrites it. Consider this example, you need to check if a given employee has equipment training (equipmentTraining). This machine only requires the lowest level of training, the level of training is unimportant.

As a result, our if statement checks if equipmentTraining still has a falsy value, the default ' '. If it does, the if statement executes and returns that the employee is not authorized. If equipmentTraining contains any string other than the default, it will have a truthy value and therefore not execute the if statement.

‍

14. Sharing methods with inheritance

Inheritance concerns a way of sharing properties or methods between classes. This is done using the super tag to allow the constructor in FlashCoupon to access the parent constructor in Coupon. In doing so, you enhance the readability of your code by only defining the methods once (in the parent class). This makes your code to be more modular since inheritor classes can be specialized for a given task.

Notice that the top code box establishes a parent class, Coupon, the properties and methods of which are shared to FlashCoupon as seen by FlashCoupon calling the getExpirationMessage method on its final line.

‍

15. Write shorter loops with array methods

For our final tip, we’ll dive into the complexity of array optimization. Loops are a common way to create and populate arrays. However, they cause a lot of clutter and can be hard to read due to the number of lines required. Instead, you can use array methods to accomplish similar effects as for loops with only a fraction of the lines. Take this for loop for example. Instead of the above code, we can get the same effect from three lines below by making use of the map method. This method creates an equivalently sized array with only the prices property. We then get float values of that price using the parseFloat.

‍

Wrapping up and resources

The quest for cleaner code is an ongoing journey since best practices are constantly evolving with the language. This process is part of the fun of software development, and learning best practices demonstrates true mastery over a programming language. To get a great head start on learning more best practices and tricks to simplify your JavaScript code, check out Pragmatic Programmer’s extensive, hands-on course Simplifying JavaScript: A Handy Guide for Software Engineers. By the end, you’ll be a productive, modern JavaScript developer.

Sako
@SarkisBuniatyan
Shanghai • Joined Sep 2020
Entrepreneur by day, product designer by night.
FollowUnfollow
Share
400
Resteps
#16
Rank
7.8k
Followers
98
Following
Are you sure you want to delete this chapter?
It contains 1 step, a thumbnail and intro video.
YesNo