这个免费的交互式课程在一小时内学习JavaScript

JavaScript is the most popular programming language on the web. You can use it to create websites, servers, games and even native apps. So no wonder it’s such a valuable skill in today’s job market.

JavaScript是网络上最流行的编程语言。 您可以使用它来创建网站,服务器,游戏,甚至本机应用程序。 因此,难怪它在当今的就业市场中是如此宝贵的技能。

So I reached out to Dylan C. Israel — a programming YouTuber and freeCodeCamp grad — and asked him to create a free JavaScript course on Scrimba.

因此,我联系了正在编程的YouTuber和freeCodeCamp毕业生Dylan C. Israel ,并要求他在Scrimba上创建免费JavaScript课程 。

The course contains 15 lectures and 7 interactive challenges and is suitable for beginners. It will give you a quick intro to the most important JavaScript concepts.

该课程包含15个讲座和7个互动挑战,适合初学者。 它将为您快速介绍最重要JavaScript概念。

Here’s how the course is laid out.

这是课程的布局方式。

第1部分:简介 (Part 1: Introduction)

As always, the course begins with a screencast about the subject in general and an overview of the course structure. Dylan will also tell you a little bit about himself so that you’ll get to know him before you dive into the coding.

与往常一样,本课程从总体讲授该课程的屏幕录像和课程结构概述开始。 迪伦(Dylan)还将告诉您一些有关他自己的信息,以便您在深入学习编码之前先认识他。

第2部分:变量 (Part 2: Variables)

The first concept you’ll need to learn is variables, which are for storing values. In modern JavaScript there are two keywords for doing that: let and const.

您需要学习的第一个概念是变量,用于存储值。 在现代JavaScript中,有两个关键字可以做到这一点: letconst

Let’s store the name Dylan in a let which we’ll call name.

让我们将名称Dylan存储在一个let ,我们将其称为name

let name = 'Dylan';  
console.log(name);// --> 'Dylan'

As you can see, we can then refer to that variable later on in order to fetch out the value, for example, to log it out to the console, using the console.log() method.

如您所见,我们稍后可以引用该变量,以获取值,例如,使用console.log()方法将其注销到控制台。

第3部分:字符串 (Part 3: Strings)

In the second lesson, you’ll learn about your first data type: strings. A string simply stores a sequence of characters wrapped in quotes. So whenever you wrap something inside single or double quotes, it’s turned into a string in JavaScript, like this:

在第二课中,您将学习第一个数据类型: strings 。 字符串仅存储用引号引起来的一系列字符。 因此,每当您在单引号或双引号中包装内容时,它就会在JavaScript中变成字符串,如下所示:

let name = "Dylan";

第4部分:弦乐挑战 (Part 4: Strings challenge)

It’s time for the first challenge of the course! In this one, you’re going to try and combine two variables into one.

现在是该课程的第一个挑战! 在这一章中,您将尝试将两个变量合并为一个。

let firstName = "Dylan";  
let lastName = "Israel";console.log(fullName);// --> ReferenceError: fullName is not defined

If this is your very first introduction to JavaScript you’ll need to use your freshly acquired knowledge of both variables and strings in order to solve this problem. You also might have to do a little code of experimentation. Luckily, this is possible in the Scrimba platform.

如果这是您JavaScript入门,那么您需要使用新获得的变量字符串知识来解决此问题。 您可能还需要做一些实验代码。 幸运的是,这在Scrimba平台中是可能的。

第5部分:数字 (Part 5: Numbers)

Next up is the second data type you’ll need to learn: numbers. Other languages often have multiple data types for numbers, like floats for decimal numbers and integers for the whole numbers_._ However, in JavaScript, they’re both numbers.

接下来是您需要学习的第二种数据类型: 数字 。 其他语言通常具有多种数字数据类型,例如,十进制数字为浮点数整数整数 _._。但是,在JavaScript中,它们都是数字

We can use the typeof to check the data type:

我们可以使用typeof来检查数据类型:

let example1 = 7;  
let example2 = 7.77;console.log(typeof example1);  
console.log(typeof example2);// --> "number"  
// --> "number"

In this lecture you’ll also learn how to convert values between strings and number using parseInt() and parseFloat() methods.

在本讲座中,您还将学习如何使用parseInt()parseFloat()方法在字符串和数字之间转换值。

第6部分:数字挑战 (Part 6: Numbers challenge)

In the numbers challenge, you’ll be exposed to a few different strings and numbers combined with the methods you’ve learned so far. Your job is to guess which values these expressions end up as.

在数字挑战中,您将接触到一些不同的字符串和数字以及到目前为止学到的方法。 您的工作是猜测这些表达式最终会变成哪个值。

let example1 = parseInt("33 World 22");  
let example2 = parseFloat('44 Dylan 33');  
let example3 = 55.3333.toFixed(0);  
let example4 = 200.0.toFixed(2);

It might be a bit tricky, so don’t be discouraged if you do mistakes!

这可能有些棘手,所以如果您犯了错误,不要气disc!

第7部分:布尔值 (Part 7: Booleans)

Booleans are simple, they’re either true or false. Here’s how you create a boolean value:

布尔值很简单,它们为truefalse。 这是创建布尔值的方法:

let example = true;

The fact that example now is set to true can come in handy when you’re programming, as you sometimes want to take actions based upon conditions like this one.

现在的example已设置为true的事实在您进行编程时会派上用场,因为有时您希望根据此类条件进行操作。

You’ll also learn about truthy or falsy values in this lecture, which are other data types, like strings or numbers, but which has a truthy or falsy side to them.

您还将了解在此讲学truthyfalsy值,它是其他数据类型,如字符串或数字,但其中有一个truthyfalsy边给他们。

第8部分:布尔运算挑战 (Part 8: Booleans challenge)

In the booleans challenge, Dylan follows the same pattern as the numbers one, where you are to guess a bunch of values. Your job is to guess whether or not these variables are truthy or falsy:

在布尔型挑战中,Dylan遵循与数字一相同的模式,在这里您要猜测一堆值。 您的工作是猜测这些变量是真实的还是虚假的:

let example1 = false;  
let example2 = true;  
let example3 = null;  
let example4 = undefined;  
let example5 = '';  
let example6 = NaN;  
let example7 = -5;  
let example8 = 0;

第9部分:数组 (Part 9: Arrays)

The data types you’ve learned up until now, are so-called primitive values. Now it’s about time to learn about the array, which is a non-primitive value.

到目前为止,您所了解的数据类型就是所谓的原始值。 现在是时候了解数组了,这是一个非原始值。

An array is simply a list of values, like this:

数组只是一个值列表,如下所示:

let example = ['programming', 'design', 'art'];

You’ll learn how to create arrays, how to add and remove items and even how to loop through the entire array using the forEach() method.

您将学习如何创建数组,如何添加和删除项目,以及如何使用forEach()方法遍历整个数组。

第10部分:数组挑战 (Part 10: Arrays challenge)

In the arrays challenge you’ll be introduced to the concept of padding by reference or value, which is important in order to understand JavaScript properly. We’ll also revisit this concept later on, as repetition will help the knowledge stick.

在数组挑战中,将向您介绍通过引用进行填充的概念,这对于正确理解JavaScript非常重要。 稍后,我们还将重新讨论该概念,因为重复将有助于知识的坚持。

let example1 = ['Dylan', 5, true];  
let example2 = example1;example2.push(11);console.log(example1);  
console.log(example2);

The results that are logged above might surprise you if you’re not aware of the passing by reference concept.

如果您不知道按引用传递概念,则上面记录的结果可能会让您感到惊讶。

第11部分:对象 (Part 11: Objects)

From arrays, we’ll continue to its close relatives called objects. Objects are like arrays in the sense that they can store multiple values. However, instead of consisting of a list of values, an object consists of so-called key-value pairs. We create an object using curly brackets:

从数组开始,我们将继续其近亲称为对象。 从某种意义上说,对象可以存储多个值,就象数组。 但是,对象不是由值列表组成,而是由所谓的键值对组成。 我们使用大括号创建一个对象:

let example = {  firstName: 'Dylan';  lastName: 'Israel'  
};

In this lecture, you’ll learn how to populate objects and fetch their values.

在本讲座中,您将学习如何填充对象并获取它们的值。

第12部分:对象挑战 (Part 12: Objects challenge)

In this challenge, we’ll revisit the concept of passing by reference or value. You’ll also learn about the Object.assign() method, which allows you to create copies of objects.

在这个挑战中,我们将重新审视通过引用传递的概念。 您还将了解Object.assign()方法,该方法使您可以创建对象的副本。

let example1 = {  firstName: 'Dylan'  
};  
let example2 = example1;  
example2.lastName = 'Israel';console.log(example1);  
console.log(example2);

第13部分:算术运算符 (Part 13: Arithmetic operators)

A programming language would be almost useless if it didn’t know how to do arithmetic operations. Doing it in JavaScript is pretty straight-forward:

如果编程语言不知道如何进行算术运算,则几乎是无用的。 使用JavaScript进行操作非常简单:

let example = 5 + 5;console.log(example)// --> 10

In this lecture, you’ll also experience how JavaScript handles expressions where multiple operations are combined.

在本讲座中,您还将体验JavaScript如何处理组合了多个操作的表达式。

第14部分:关系运算符 (Part 14: Relational operators)

When programming we often have to compare values, to see if they’re equal to each other, or if one of them is larger than the other, so in this lecture, you’ll learn how to do that.

在编程时,我们经常必须比较值,以查看它们是否相等,或者其中一个大于另一个,因此在本讲座中,您将学习如何做到这一点。

let example1 = 10;  
let example2 = 15;console.log(example1 > example2)// --> false

And real-world example of this would be when you want to check if a user has got enough credit to purchase an item. If the credit is above the price, then they’re allowed to buy, otherwise, they’re not.

现实的例子就是您想检查用户是否有足够的信用购买商品。 如果信用额高于价格,则允许他们购买,否则,则不允许购买。

第15部分:关系运算符的挑战 (Part 15: Relational operators challenge)

In this challenge you’ll be able to test how well you understand relational operators, through guessing the boolean value of these variables:

在这个挑战中,您将能够通过猜测以下变量的布尔值来测试您对关系运算符的理解程度:

let example1 = 5 === 5;  
let example2 = 5 == '5';  
let example3 = 6 != '6';  
let example4 = 7 !== '7';

第16部分:递增和递减 (Part 16: Increment & decrement)

Making values grow or shrink is very often done in programming, for example when you’re counting. It can be done in a few different ways, though, so it deserves its own lecture.

使价值增长或收缩通常是在编程中完成的,例如,在进行计数时。 但是,它可以通过几种不同的方式来完成,因此值得一听。

let example = 1;  
example = example + 1;console.log(example);// --> 2

第17部分:递增和递减挑战 (Part 17: Increment & decrement challenge)

This challenge will look at the difference between doing example++ and ++example.

这项挑战将着眼于执行example++++example之间的区别。

This might require you to experiment a bit in order to understand it, or even googling, which also is a critical skill for any developer.

这可能需要您进行一些尝试才能理解它,甚至需要进行谷歌搜索,这对于任何开发人员来说都是至关重要的技能。

第18部分:如果,否则,如果不是 (Part 18: If, else if, else)

Conditional statements like if, if else and else are critical when programming. It’s what allows you to have logic in your application. So in this lecture, you’ll learn how to work with all three of them.

编程时,条件语句(如ifif elseelse至关重要。 这就是使您在应用程序中具有逻辑的原因。 因此,在本讲座中,您将学习如何使用所有这三个方法。

let example = 5;if (example === 5) {  console.log('Runs');  
} else if ( true ) {  console.log('else if');  
} else {  console.log('else');  
}

You’ll also learn about how to combine these conditionals with relational operators to make complex logic.

您还将学习如何将这些条件与关系运算符结合起来以构成复杂的逻辑。

第19部分:如果,否则,如果挑战 (Part 19: If, else if, else challenge)

In this challenge, you’ll try to guess what the following expressions evaluate to. This builds upon both what you’ve learned in the relational operators' lecture and in the previous one.

在这个挑战中,您将尝试猜测以下表达式的计算结果。 这是建立在您在关系运算符的讲座和上一堂课中学到的知识的基础上。

console.log(10 === 10 && 5 < 4);  
console.log(10 === 10 || 5 < 4);  
console.log((5 >= 5 || 4 > 4) && 3 + 2 === 5);

Again, don’t lose the courage if you don’t manage to guess correctly. This stuff is tricky for a beginner!

同样,如果您无法正确猜测,也不要失去勇气。 对于初学者来说,这些东西很棘手!

第20部分:开关 (Part 20: Switch)

In this lecture, you’ll learn about so-called switch statements, which are really handy if you have many conditions to check between. Here’s an example of that:

在本讲座中,您将学习所谓的switch语句,如果您有许多条件需要检查的话,这些语句非常有用。 这是一个例子:

let studentAnswer = 'D';switch(studentAnswer) {  case 'A':  console.log('A is wrong.');  break;  case 'B' :  console.log('B is wrong.');  break;  case 'C':  console.log('C is correct.');  break;  default:  console.log('Not a real answer.');  
}

第21部分:For循环 (Part 21: For loop)

For loops allow you to execute a block of code a number of times. The amount is dictated by you by setting three conditionals. Here’s an example of a simple for loop:

For循环使您可以多次执行代码块。 金额由您通过设置三个条件决定。 这是一个简单的for循环的示例:

for (let i = 0; i < 5; i++) {  console.log(i);  
}// -->  
// 0  
// 1  
// 2  
// 3  
// 4

In this lecture, you’ll see how you can calculate the total sum of an array of numbers using a for loop.

在本讲座中,您将看到如何使用for循环来计算数字数组的总和。

第22部分:While&While (Part 22: While & do while)

If you want to execute a piece of code multiple times but don’t know how many times, then a while loop might be exactly what you need. It allows you to execute a block of code as long as a certain condition is met.

如果要执行一段代码多次,但不知道多少次,那么while你需要的循环可能完全相同。 只要满足特定条件,它就可以执行代码块。

let count = 0;while (count < 20) {  count++;  
}console.log(count);

You’ll also learn about the do/while statement.

您还将了解do/while语句。

第23部分:函数 (Part 23: Functions)

Finally, you’ll need to learn about functions, as it’s critical for any application. You’ll learn the syntax of functions, how they’re called and how you can add parameters to them.

最后,您需要了解函数,因为函数对于任何应用程序都是至关重要的。 您将学习函数的语法,如何调用它们以及如何向它们添加参数。

function add() {  console.log('add');  
}add();// --> 'add'

And when you’ve finished this lecture you’re done with the syllabus for this course, as you know have an understanding of the core concepts in JavaScript.

当您完成本教程的学习后,您将完成本课程的教学大纲,因为您知道自己已经了解了JavaScript的核心概念。

第24部分:接下来是什么? (Part 24: What’s next?)

Dylan ends the course by telling you a little bit about what you can do next in order to further improve your JavaScript skills! Remember, this course was just the beginning.

Dylan通过向您介绍一些接下来可以做什么以进一步提高JavaScript技能来结束本课程! 请记住,这只是一门课程。

Once you’ve reached this far, I’d strongly encourage you to continue, as you’re on track to gain highly valuable skill in today's society.

一旦您达到了这一目标,我强烈建议您继续前进,因为您正在逐步获得当今社会非常宝贵的技能。

Not only can JavaScript help you improve your career, but you’ll also be able to build products on your own!

JavaScript不仅可以帮助您改善职业生涯,而且还可以自行构建产品!

So be sure to take this free course today. You’ll be able to build projects in JavaScript on your own before you know it!

因此,请务必今天就参加此免费课程 。 您将能够在不知不觉中自行使用JavaScript构建项目!



Thanks for reading! My name is Per Borgen, I'm the co-founder of Scrimba – the easiest way to learn to code. You should check out our responsive web design bootcamp if want to learn to build modern website on a professional level.

谢谢阅读! 我叫Per Borgen,我是Scrimba的共同创始人–学习编码的最简单方法。 如果要学习以专业水平构建现代网站,则应查看我们的响应式Web设计新手训练营 。

翻译自: https://www.freecodecamp.org/news/want-to-learn-javascript-heres-a-free-24-part-course-to-get-you-started-e7777baf86fb/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/394414.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java中二进制怎么说_面试:说说Java中的 volatile 关键词?

volatile 这个关键字可能很多朋友都听说过&#xff0c;或许也都用过。在 Java 5 之前&#xff0c;它是一个备受争议的关键字&#xff0c;因为在程序中使用它往往会导致出人意料的结果。在 Java 5之后&#xff0c;volatile 关键字才得以重获生机。volatile 关键字虽然从字面上理…

类的详解

面向对象是一种编程方式&#xff0c;此编程方式的实现是基于对类和对象的使用。类是一个模板&#xff0c;模板中包装了多个“函数”供使用&#xff08;可以讲多函数中公用的变量封装到对象中&#xff09;。对象&#xff0c;根据模板创建的实例&#xff08;即对象&#xff09;&a…

leetcode279. 完全平方数(动态规划)

给定正整数 n&#xff0c;找到若干个完全平方数&#xff08;比如 1, 4, 9, 16, …&#xff09;使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 示例 1: 输入: n 12 输出: 3 解释: 12 4 4 4. 解题思路 数组含义&#xff1a;dp[i]数字i对应组成和的完全平方…

什么情况不能办理房产抵押贷款 房产抵押贷能贷多少?

所谓房产抵押贷款是指以自己或亲友的房产作为抵押物向贷款机构申请贷款&#xff0c;款项可用于企业经营、买房、买车、装修及其他用途的融资方式。但是有些情况是规定不能申请房产抵押贷款的&#xff0c;而且贷款的数额是有限的&#xff0c;不是想贷多少就多少。那么&#xff0…

Android RecyclerView 二级列表实现

Android RecyclerView 二级列表实现

2数据库表增加一个字段_14个实用的数据库设计技巧!

1. 原始单据与实体之间的关系可以是一对一、一对多、多对多的关系。在一般情况下&#xff0c;它们是一对一的关系&#xff1a;即一张原始单据对应且只对应一个实体。在特殊情况下&#xff0c;它们可能是一对多或多对一的关系&#xff0c;即一张原始单证对应多个实体&#xff0c…

错误: 找不到或无法加载主类 helloworld_全面剖析虚拟机类加载机制

1.引言java源文件经过编译后生成字节码class文件&#xff0c;需要经过虚拟机加载并转换成汇编指令才能执行&#xff0c;那么虚拟机是如何一步步加载这些class文件的对于java程序员是完全透明的&#xff0c;本文尝试全面分析jvm类加载机制。2.思考开始之前我们来简单思考一下&am…

nginx反向代理和shiro权限校验产生的404问题

问题描述: 我们的项目A&#xff08;以下简称A&#xff09;用了shiro做权限校验&#xff0c;nginx做反向代理&#xff0c;在另一个项目B&#xff08;以下简称B&#xff09;中点击某个A的链接时实现单点登录并会跳转到该路径。跳转到原路径的时候nginx报了404。出现404之后再次点…

android 揭示动画_如何使用意图揭示函数名称使代码更好

android 揭示动画Discover Functional JavaScript was named one of the best new Functional Programming books by BookAuthority!“发现功能JavaScript”被BookAuthority评为最佳新功能编程书籍之一 &#xff01; Code is a way to communicate with developers reading it…

200道物理学难题——038蚱蜢跃树

转载于:https://www.cnblogs.com/hanford/p/6168514.html

(转)dp动态规划分类详解

dp动态规划分类详解 转自&#xff1a;http://blog.csdn.NET/cc_again/article/details/25866971 动态规划一直是ACM竞赛中的重点&#xff0c;同时又是难点&#xff0c;因为该算法时间效率高&#xff0c;代码量少&#xff0c;多元性强&#xff0c;主要考察思维能力、建模抽象能力…

strcmp可以比较数组么_大家都用过百度云,但你面试过百度云么

作者&#xff1a;黄小斜百度研发面经百度智能云软件研发工程师百度智能云研发岗好像是做控制台方面的组一面&#xff1a;1自我介绍&#xff0c;项目2 static关键字有什么用&#xff0c;static修饰不同东西时有什么作用&#xff0c;内部类用static修饰和不用static修饰有何区别。…

leetcode785. 判断二分图(dfs和bfs染色)

给定一个无向图graph&#xff0c;当这个图为二分图时返回true。 如果我们能将一个图的节点集合分割成两个独立的子集A和B&#xff0c;并使图中的每一条边的两个节点一个来自A集合&#xff0c;一个来自B集合&#xff0c;我们就将这个图称为二分图。 graph将会以邻接表方式给出…

bdd cucumber_如何使用BDD构建坚如磐石的Ruby on Rails应用

bdd cucumberby Marko Anastasov通过Marko Anastasov 如何使用BDD构建坚如磐石的Ruby on Rails应用 (How to build rock-solid Ruby on Rails apps with BDD) 了解通过行为驱动开发来构建可持续Web应用程序的最佳实践。 (Learn best practices for building sustainable web a…

go kegg_KEGG分析及可视化

上一篇推文中我们解释了GO富集分析及可视化&#xff08;GO富集分析及可视化&#xff09;&#xff0c;除了GO富集分析&#xff0c;我们经常在paper中看到KEGG分析&#xff0c;KEGG是什么呢&#xff0c;Kyoto Encyclopedia of Genes and Genomes&#xff0c;京都基因和基因组百科…

IntelliJ IDEA注册码

IntelliJ IDEA注册码 http://idea.lanyus.com/ 1.导航栏下 2.help下 3.register点击 4.单选Activation code 5.粘贴注册码 转载于:https://www.cnblogs.com/YUJIE666/p/10662561.html

单词本.

offset 偏移量 charset字符集 str 代表String字符串 IgnoreCase忽略大小写 Object 对象 argument 参数 if and only if:当且仅当 value:值 specified:指定 Parameters:参数 iterator:迭代器 invoke:调用 variable:变量 resolved:解决 sequnence 序列 default:默认转载于:http…

leetcode931. 下降路径最小和(动态规划)

给定一个方形整数数组 A&#xff0c;我们想要得到通过 A 的下降路径的最小和。 下降路径可以从第一行中的任何元素开始&#xff0c;并从每一行中选择一个元素。在下一行选择的元素和当前行所选元素最多相隔一列。 示例&#xff1a; 输入&#xff1a;[[1,2,3],[4,5,6],[7,8,9…

lvm使用

注&#xff1a;新添加的硬盘&#xff0c;如果没有分区&#xff0c;可以直接使用pvcreate进行创建&#xff0c;然后用vgextend进行扩展如果新添加的硬盘经过分区&#xff0c;则要把需要扩展的分区修改为8e格式&#xff0c;则进行扩展以上内容实测~相关概念&#xff1a;pv:物理卷…

python django用户登录系统_Django实现用户注册登录

学习Django中&#xff1a;试着着写一个用户注册登录系统&#xff0c;开始搞事情 O(∩_∩)O哈哈~Ubuntupython 2.7.12Django 1.10.4IDE&#xff1a;PycharmBootstrap(其实没怎么用~~)新建项目&#xff1a;(我是直接用pycharm直接生成的)使用终端&#xff1a;(创建项目)django-ad…