codepen_1. Codepen

codepen

Are you a type of programmer who loves to write every single line of code? Or the one who knows where to find snippets and get benefits from it?

您是喜欢编写每一行代码的程序员吗? 还是知道在哪里可以找到摘要并从中受益的人?

I’m the second type. Why bother to write it yourself when you know there’re snippets you need out there? You may think the more code you write, the more skills you will improve. No, it’s not. Especially when you write the same code over and over again.

我是第二种。 当您知道那里需要片段时,为什么还要自己动手写呢? 您可能会认为编写的代码越多,您将提高的技能就越多。 不,这不对。 尤其是当您一遍又一遍地编写相同的代码时。

So, leave the normal logic for snippets to put more effort into the significant tasks.

因此,保留片段的常规逻辑可以将更多精力投入到重要任务中。

Below are the places you can find useful snippets. Check it out.

以下是您可以找到有用片段的地方。 看看这个。

1. Codepen (1. Codepen)

https://codepen.io

https://codepen.io

Image for post

Besides being a great online playground, codepen contains a lot of code snippets that will benefit your tasks. In addition, you will get inspired by the snippets collection right on the homepage. They’re smooth and beautiful.

除了是一个不错的在线游乐场之外,codepen还包含许多代码片段,这些代码片段将使您的工作受益。 此外,您还将直接从首页上的代码片段集合中获得启发。 它们光滑漂亮。

2. CSS技巧 (2. CSS-Tricks)

https://css-tricks.com/snippets/javascript/

https://css-tricks.com/snippets/javascript/

Image for post

Hmm, CSS tricks, isn’t it supposed to be a CSS resource? Yes, but not only CSS. In fact, you can find really useful JS snippets here.

嗯,CSS技巧,难道它不应该是CSS资源吗? 是的,但不仅限于CSS。 实际上,您可以在这里找到非常有用的JS代码段。

The list is selected by only one person, Chris Coyier, so you can’t expect it to be the large one. But it shouldn’t be a problem if you find something that fits your tasks here.

该列表仅由一个人Chris Coyier选择,因此您不能期望它会是很大的列表。 但是,如果您在此处找到适合自己任务的内容,那应该不成问题。

3. 30秒的代码 (3. 30 Seconds of Code)

https://www.30secondsofcode.org

https://www.30secondsofcode.org

Image for post

By “30 seconds of code”, this website means the code you can understand in approximately 30 seconds.

通过“ 30秒的代码”,该网站表示您可以在大约30秒内理解的代码。

The code snippets here are organized by tags and categories, which is convenient for you to search for the one you need. More and more snippets are updated frequently. This could be your treasure to find most of the snippets you need for your projects.

此处的代码段按标签和类别进行组织,方便您搜索所需的代码段。 越来越多的代码片段会经常更新。 这可能是您找到项目所需的大多数代码片段的宝藏。

4.有用的角度 (4. Useful Angle)

https://usefulangle.com/javascript

https://usefulangle.com/javascript

Image for post

The list of snippets at Useful Angle is updated frequently.

有用角度的代码片段列表会经常更新。

The best part: it’s well documented and explained.

最好的部分:有充分的记录和解释。

5.代码去 (5. Code to Go)

https://codetogo.io/all/

https://codetogo.io/all/

Image for post

Simple UI and very basic code, Code to go is suitable for mostly the beginners.

简单的UI和非常基本的代码,Code to go适合大多数初学者。

6. Snippetlib (6. Snippetlib)

https://snippetlib.com/jquery

https://snippetlib.com/jquery

Image for post

This one is selected by Jessie Frazelle. As time passes, it becomes a public library which contains a number of snippets in several programming languages.

这是由Jessie Frazelle选择的。 随着时间的流逝,它变成了一个公共库,其中包含许多使用多种编程语言编写的代码段。

7. Snipplr (7. Snipplr)

https://snipplr.com/popular?language=javascript

https://snipplr.com/popular?language=javascript

Image for post

Snipplr provides two main features: saving and sharing your snippets. There’re thousand of snippets you can find here with various languages including, of course, JavaScript. With the advanced search feature, you can narrow down the results to easily pick the one that suits you most.

Snipplr提供两个主要功能:保存和共享您的代码片段。 您可以在这里找到数千种使用各种语言(包括JavaScript)的代码段。 使用高级搜索功能,您可以缩小搜索范围,轻松挑选最适合的搜索结果。

8. Codota (8. Codota)

https://www.codota.com/code/javascript/module-index

https://www.codota.com/code/javascript/module-index

Image for post

Codota comes with a huge list of snippets. Plus, finding a snippet for your need here is super easy because of the intelligent search capabilities.

Codota附带了大量的摘要。 此外,由于具有智能搜索功能,因此在这里找到您所需的代码片段非常容易。

The ready-to-use code snippets are very helpful. Instead of spending time writing code for easy and repetitive tasks, you should use snippets to save time for focusing on the complex ones.

即用型代码片段非常有用。 您不必花时间编写代码来完成简单且重复的任务,而应使用代码片段来节省时间来专注于复杂的代码。

Do you know anywhere else to find snippets? Leave a comment below to complete the list.

您是否知道其他地方可以找到摘要? 在下面发表评论以完成列表。

进一步阅读 (Further Reading)

普通英语JavaScript (JavaScript In Plain English)

Enjoyed this article? If so, get more similar content by subscribing to Decoded, our YouTube channel!

喜欢这篇文章吗? 如果是这样,请订阅我们的YouTube频道解码,以获得更多类似的内容

翻译自: https://medium.com/javascript-in-plain-english/8-places-to-find-helpful-javascript-snippets-3733b8a62768

codepen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值