Could JavaScript get any hotter? As long as web development is growing, JavaScript will be an implacable trending. And your life as a web developer can’t live without it.
JavaScript会更热门吗? 只要Web开发不断发展,JavaScript就会成为必然趋势。 作为Web开发人员的生活离不开它。
That’s why you need to be better every day. And 9 tips below are going to help you achieve it.
这就是为什么您需要每天变得更好。 以下9个技巧将帮助您实现这一目标。
1.写关于你学到的东西 (1. Write About What You Learned)
When you write about what you learned, you give yourself another chance to remind the knowledge, thoroughly.
当您写下所学知识时,您将给自己另一个机会来全面地提醒知识。
Think about it. To write an article, you need to systematize what you know to convey it comprehensively. When you put in more effort like that, you will hardly forget your knowledge.
想一想。 要撰写文章,您需要将您所知道的内容系统化以全面地传达它。 当您付出更多的努力时,您几乎不会忘记自己的知识。
Not only write about what I know but also I write about what I want to learn. I find it one of the best ways to learn something new. It forces me to research carefully before writing to make sure everything is correct. That way, I learn about the topic and also improve my writing skills.
我不仅写关于我所知道的东西,而且写关于我想学的东西。 我发现这是学习新事物的最好方法之一。 它迫使我在写作之前仔细研究以确保所有内容都是正确的。 这样,我就可以了解该主题并提高写作技巧。
2.一项功能,一项任务 (2. One Function, One Task)
I don’t buy the idea to put everything into a single function to make it an ultimate one. When I started my career as a programmer, I did it often. Then I found it really hard to debug a big function rather than a small function one.
我不赞成将所有功能都集成到一个功能中来使其最终成为一个功能的想法。 当我以程序员身份开始职业生涯时,我经常这样做。 然后我发现调试一个大功能而不是一个小功能真的很困难。
Now, I tend to break my code into small even tiny functions to make things clean and pretty.
现在,我倾向于将代码分解为很小甚至很小的函数,以使事情变得干净漂亮。
Example:
例:
// Don’t
function validateAndLogIn() {
}// Do
function validate() {
}function login() {
}
3.始终处理多个浏览器 (3. Always Deal With Multiple Browsers)
Cross-browser compatibility is one of the important problems you have to deal with as a web developer. Different browsers treat your JavaScript code differently. A block displays perfectly on Chrome doesn’t mean it will work well on Firefox. Even in the same browser but different version also generates bugs, let alone same browser same version but on different devices (strange, but it happens sometimes).
跨浏览器兼容性是作为Web开发人员必须解决的重要问题之一。 不同的浏览器对JavaScript代码的处理方式不同。 在Chrome上完美显示一个方块并不意味着它将在Firefox上正常运行。 即使在相同的浏览器中,但不同的版本也会生成错误,更不用说同一浏览器的相同版本,但在不同的设备上(奇怪,但有时会发生)。
Fortunately, some browser compatibility testing tools will give you a hand to overcome this headache problem. The one you can use is Experitest. With its help, you can say goodbye to your local devices and having your website tested over thousands of desktop and mobile browsers on cloud.
幸运的是,某些浏览器兼容性测试工具将帮助您克服这一令人头疼的问题。 您可以使用的是Experitest 。 有了它的帮助,您可以告别本地设备,并通过数千种台式机和移动浏览器在云上对您的网站进行测试。
Before going live, make sure your site works well on as many browsers as possible.
在上线之前,请确保您的网站在尽可能多的浏览器上都能正常运行。
4.订阅有用的新闻通讯和频道 (4. Subscribe to Useful Newsletters and Channels)
In the age of overloaded with information, having a handful of useful sources will help you to concentrate on what matters. Your time is limited. If you want to master JavaScript, you should subscribe to valuable newsletters and channels.
在信息过载的时代,拥有少量有用的资源将帮助您专注于重要的事情。 您的时间有限。 如果您想精通JavaScript,则应该订阅有价值的新闻通讯和频道。
JavaScript in Plain English is a good one in terms of providing up-to-date knowledge, practical tutorials, tips, and insights. And if you want even more, check out the list below:
就提供最新知识,实用教程,技巧和见解而言,纯英语JavaScript是一个不错的选择。 如果您想要更多,请查看以下列表:
5.指甲基础(5. Nail The Basics)
Are you confident that you know all about the basics of JavaScript? I’m not. Sometimes I find myself forget the foundation like some built-in functions that I should use rather than creating my own ones.
您有信心了解JavaScript的全部知识吗? 我不是。 有时我发现自己忘记了一些诸如我应该使用而不是创建自己的内置函数之类的内置函数的基础。
How many times do you fall into a situation like that? A lot, I guess. And that’s because you just chase the advanced knowledge but ignoring the basic ones.
你经历过几次这样的情况? 我想很多。 那是因为您只是追求高级知识而忽略了基础知识。
Everything starts with the basics. Don’t underestimate it. Complex logic or big algorithm are built from every single loop and if. Therefore, take your time and nail it.
一切都从基础开始。 不要小看它。 复杂的逻辑或大型算法是从每个循环以及if中构建的。 因此,花点时间钉好它。