未加星标

Editorial: What Do You Want to Learn in 2017?

字体大小 | |
[前端(javascript) 所属分类 前端(javascript) | 发布者 店小二03 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

This is the editorial from our latest javascript newsletter, you cansubscribe here.

Hey everyone, welcome to a brand new year on SitePoint JavaScript. I hope you had a great break (for those of you that took one) and are ready to start off 2017 with a bang.

More from this author Editorial: What Does Open Source Mean to You? Editorial: Is JavaScript Always the Best Solution?

2016 was a crazy year for JavaScript! We saw an ever increasing adoption of ES6 and the rise of progressive web apps. Also, Yarn emerged as a competitor to npm and JavaScript fatigue fatigue became a thing. In case you missed any of this, or you’d simply like to reminisce on the year just passed, we’ve got you covered. Craig Buckler looks at these events and more in his post JavaScript: 2016 in Review . It’s well worth a read.

Looking forward to 2017 I wonder two things. Will this year be as crazy as the last? And where should I focus my learning efforts in the coming 365 days? The answer to the first question is “almost definitely”, but the answer to the second is somewhat more complicated. Knowing what to learn depends rather a lot on your situation, for example are you looking for a new job? Do you want to become more productive in your current one? Or do you want to check out a couple of new technologies to get a feel for how they stack up against those you already know?

If you’re in that last group, we’ve got you covered there, too. Tim Severien started 2017 by taking a look at three libraries that are worth keeping an eye on in this coming year . I’d encourage you to give that post a read and let Tim know if you agree with his choices (spoiler: one of them is Vue.js).

As for me, I decided that one of my goals for 2017 would be to cut back on my use of jQuery. This isn’t because I’ve suddenly jumped on the anti-jQuery bandwagon. I haven’t. Rather because jQuery was so awesome when it first came on the scene, that today I often use it without thinking. I don’t stop and consider what browsers can do natively.

And actually, this jQuery diet is working out quite well. For example, I recently needed to select an element’s closest parent element, which was an anchor tag. In jQuery that’d be no problem, you’d do $el.closest("a") but in vanilla JS I was unsure. So I hit youmightnotneedjquery.com , entered “closest” as the search term and got back zero results. Hmm … not ideal.<7p>

I had a go at putting together my own solution and came up with this:

while (el.parentNode.tagName !== 'A') {
el = el.parentNode;
}

Which worked, but was kinda ugly. I then googled a bit and found that both Firefox and Chrome implement element.closest() natively. This was all I needed. Job done!

Obviously, replacing jQuery with experimental browser features isn’t an option all the time. If you’re worried about compatibility for older browsers, then using it is a no-brainer. And spending minutes googling what would have taken seconds in jQuery isn’t exactly productive. But even today, websites download many KB of JavaScript, to do what has been part of the standard DOM for years. Incorporating this change into the way I work will force me to become more familiar with what modern browsers are capable of ― a worthy goal for 2017.

But what about you? Where will you be concentrating your energies for the next 365 days? Do you intend to learn a new framework (if so which one)? Will you be giving Node a try? Or maybe your goal is to attend a meetup or contribute to open source.

Whatever it is (or isn’t), I’d love to hear about it in the comments below.

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

主题: JavaScriptjQueryJavaChromeFirefox
分页:12
转载请注明
本文标题:Editorial: What Do You Want to Learn in 2017?
本站链接:http://www.codesec.net/view/522333.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(44)