From bc879e14d28674d7becfcd50b7023fa4926b8d22 Mon Sep 17 00:00:00 2001 From: Vel Kumric Date: Sun, 4 Nov 2018 01:05:54 -0500 Subject: [PATCH] Feat/add guide article for javascript (#34007) --- .../index.md | 26 ++++++++- guide/english/html/attributes/links/index.md | 56 ++++++++++--------- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript/index.md index 66d86a74ca..38c4bc8a50 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/basic-javascript/multiply-two-decimals-with-javascript/index.md @@ -1,10 +1,30 @@ --- title: Multiply Two Decimals with JavaScript --- + ## Multiply Two Decimals with JavaScript +JavaScript uses the `*` symbol for multiplication. Multiplying floats is the same as multiplying integers. JavaScript only has the *number* type, which serves both integer and floating point numbers, it does not have a specific type for integers. -This is a stub. Help our community expand it. +For example, if you were to multiply 2 integers, the numbers 3 and 5, then you could simply type: +```javascript +var product = 3 * 5; // product is 15 +``` +Now if we were to multiply two floating point numbers, 3.4 and 5.7, the product would be a float as well: +```javascript +var product = 3.4 * 5.7; // product is 19.38 +``` -This quick style guide will help ensure your pull request gets accepted. +### Hint 1 +Think about what decimal number, when multiplied by 2.0, would equal 5.0. - +> *try to solve the problem now* + +## Spoiler Alert! +__Solution Ahead!__ + +### Code Solution +```javascript +var product = 2.0 * 2.5; // product is 5.0 because 2.5 * 2.0 = 5.0 +``` +#### More Information +* [DigitalOcean - How to do Math in JavaScript with Operators](https://www.digitalocean.com/community/tutorials/how-to-do-math-in-javascript-with-operators) diff --git a/guide/english/html/attributes/links/index.md b/guide/english/html/attributes/links/index.md index 2caecc3055..8856d2b33f 100644 --- a/guide/english/html/attributes/links/index.md +++ b/guide/english/html/attributes/links/index.md @@ -1,45 +1,49 @@ --- title: Links --- + ## Links -This is a stub. Help our community expand it. - -This quick style guide will help ensure your pull request gets accepted. - - -Links are used everywhere on the web, with the purpose if directing users to various content items. They're usually indicated by your cursor turning into a hand icon. Links can be text, images or other elements contained within your HTML or webpage. - -You use an ```code ``` tag or anchor element to define your link, which also also needs a destination address that you'll access with the ```code href``` attribute. Here's a snippet that makes the phrase 'the freeCodeCamp Guide' a link: +### General Links +Links are used everywhere on the web, with the purpose of directing users to various content items. They're usually indicated by your cursor turning into a hand icon. Links can be text, images, or other elements contained within your HTML or webpage. +You use an anchor element/tag `` to define your link, which also needs a destination address(url) that you'll access with the `href` attribute. ```html -the freeCodeCamp Guide +Link Text ``` - -If you'd like your link to open in a new tab, you'll use the ```code target``` attribute along with the ```code "_blank"``` value inside your opening ```code ``` tag. That looks like this: - +Here's a snippet that makes the phrase 'The freeCodeCamp Guide' a link: ```html -the freeCodeCamp Guide +The freeCodeCamp Guide ``` +The link ends up looking like this: [The freeCodeCamp Guide](https://guide.freecodecamp.org) -When you need to guide users to a specific part of your webpage, let's assume the very bottom, you first need to assign the hash ```code #``` symbol to the ```code href``` attribute, like this - -```html -More about us +### Links in a New Tab +If you'd like your link to open in a new tab, you'll use the `target` attribute along with the `"_blank"` +value inside your opening `` tag. That looks like this: +```html +Link Text ``` - -you'll then need to use an ```code id``` attribute in the element you want to direct your user to - in this case the ```code