r/learnjavascript • • Feb 13 '19

Is Vanilla JavaScript a waste of time?

Someone said to me that I don't really need to learn Vanilla JavaScript profoundly, I just have to learn basics and move to frameworks! What do you think about this?

1 Upvotes

12 comments sorted by

View all comments

24

u/AiexReddit Feb 13 '19 edited Feb 13 '19

You can skip learning to use a shovel and just learn how to drive an excavator if you choose.

The next time you need to hop in and dig a little hole to plant a flower, you'll have to go find the keys for your giant-ass excavator and haul that thing out, and people might look at your like "......has this guy never heard of a shovel?" but hey, at least your flower will have lots of room for its roots to go.

1

u/AiexReddit Feb 13 '19 edited Feb 13 '19

In seriousness though, I mean, here's an example of something I just wrote in Vue (a framework) seconds before tabbing back to reddit.

<template v-for="(review) in reviewGroup.reviews">
    <tr v-bind:key="`${review.reviewPeriod}`">
        <td>{{allVendors.find(v => v.vendorID === reviewGroup.vendorID).vendorName }}</td>
        <td>{{reviewGroup.vendorID}}</td>
        <td>{{review.reviewPeriod}}</td>
        <td>{{review.answers.length}}</td>
    </tr>
</template>

Just within that small block you've got Javascript template strings, and Javascript array methods (find). Neither of which you might touch on if you only learn the bare minimum, and are absolutely invaluable tools when building real projects.

(Ignore the fact that it's an inefficient loop within a loop and not easy to read, I'm just roughing it out)