Add superblock ordering
This commit is contained in:
@ -0,0 +1,810 @@
|
||||
{
|
||||
"name": "Basic Algorithm Scripting",
|
||||
"order": 8,
|
||||
"time": "50h",
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d2c442eddfbeb5bd1f",
|
||||
"title": "Get Set for Bonfires",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/sJkp30a.png",
|
||||
"An image of our a Bonfire challenge showing directions, tests, and the code editor.",
|
||||
"Bonfires are algorithm challenges that teach you how to think like a programmer.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/d8LuRNh.png",
|
||||
"A mother bird kicks a baby bird out of her nest.",
|
||||
"Our Waypoint challenges merely introduced you to programming concepts. For our Bonfire challenges, you'll now need to apply what you learned to solve open-ended problems.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/WBetuBa.jpg",
|
||||
"A programmer punching through his laptop screen in frustration.",
|
||||
"Bonfires are hard. It takes most campers several hours to solve each Bonfire. You will get frustrated. But don't quit.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/5pAl7TV.jpg",
|
||||
"A beagle winking and pointing his paw at you.",
|
||||
"When you get stuck, just use the Read-Search-Ask methodology.<br>Don't worry - you've got this.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Prepárate para los Ziplines",
|
||||
"descriptionEs": [],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "ad7123c8c441eddfaeb5bdef",
|
||||
"title": "Meet Bonfire",
|
||||
"description": [
|
||||
"Your goal is to fix the failing test.",
|
||||
"First, run all the tests by clicking \"Run tests\" or by pressing Control + Enter.",
|
||||
"The failing test is in red. Fix the code so that all tests pass. Then you can move on to the next Bonfire.",
|
||||
"Make this function return true no matter what."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof meetBonfire() === \"boolean\", 'message: <code>meetBonfire()</code> should return a boolean value.');",
|
||||
"assert(meetBonfire() === true, 'message: <code>meetBonfire()</code> should return true.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function meetBonfire(argument) {",
|
||||
" // Good luck!",
|
||||
" console.log(\"you can read this function's argument in the developer tools\", argument);",
|
||||
"",
|
||||
" return false;",
|
||||
"}",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"meetBonfire(\"You can do this!\");"
|
||||
],
|
||||
"solutions": [
|
||||
"function meetBonfire(argument) {\n // Good luck!\n console.log(\"you can read this function's argument in the developer tools\", argument);\n\n return true;\n}\n\n\n\nmeetBonfire(\"You can do this!\");\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "¡Bienvenido a los Bonfires!",
|
||||
"descriptionEs": [
|
||||
"Tu objetivo es arreglar la prueba que falla",
|
||||
"Primero, ejecuta todos las pruebas dando click en \"Run tests\" o presionando Control + Enter.",
|
||||
"La prueba que falla está marcada en rojo. Arregla el código de tal forma que todos las pruebas pasen. Luego, puedes continuar con el siguiente Bonfire",
|
||||
"Haz que esta función devuelva true (verdadero) bajo cualquier circunstancia."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a202eed8fc186c8434cb6d61",
|
||||
"title": "Reverse a String",
|
||||
"tests": [
|
||||
"assert(typeof reverseString(\"hello\") === \"string\", 'message: <code>reverseString(\"hello\")</code> should return a string.');",
|
||||
"assert(reverseString(\"hello\") === \"olleh\", 'message: <code>reverseString(\"hello\")</code> should become <code>\"olleh\"</code>.');",
|
||||
"assert(reverseString(\"Howdy\") === \"ydwoH\", 'message: <code>reverseString(\"Howdy\")</code> should become <code>\"ydwoH\"</code>.');",
|
||||
"assert(reverseString(\"Greetings from Earth\") === \"htraE morf sgniteerG\", 'message: <code>reverseString(\"Greetings from Earth\")</code> should return <code>\"htraE morf sgniteerG\"</code>.');"
|
||||
],
|
||||
"description": [
|
||||
"Reverse the provided string.",
|
||||
"You may need to turn the string into an array before you can reverse it.",
|
||||
"Your result must be a string.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function reverseString(str) {",
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"reverseString(\"hello\");"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global String Object",
|
||||
"String.split()",
|
||||
"Array.reverse()",
|
||||
"Array.join()"
|
||||
],
|
||||
"solutions": [
|
||||
"function reverseString(str) {\n return str.split('').reverse().join(\"\");\n}\n\nreverseString('hello');\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Invierte el texto",
|
||||
"descriptionEs": [
|
||||
"Invierte la cadena de texto que se te provee",
|
||||
"Puede que necesites convertir la cadena de texto en un arreglo antes de que puedas invertirla",
|
||||
"El resultado debe ser una cadena de texto",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a302f7aae1aa3152a5b413bc",
|
||||
"title": "Factorialize a Number",
|
||||
"tests": [
|
||||
"assert(typeof factorialize(5) === 'number', 'message: <code>factorialize(5)</code> should return a number.');",
|
||||
"assert(factorialize(5) === 120, 'message: <code>factorialize(5)</code> should return 120.');",
|
||||
"assert(factorialize(10) === 3628800, 'message: <code>factorialize(10)</code> should return 3628800.');",
|
||||
"assert(factorialize(20) === 2432902008176640000, 'message: <code>factorialize(20)</code> should return 2432902008176640000.');",
|
||||
"assert(factorialize(0) === 1, 'message: <code>factorialize(0)</code> should return 1.');"
|
||||
],
|
||||
"description": [
|
||||
"Return the factorial of the provided integer.",
|
||||
"If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.",
|
||||
"Factorials are often represented with the shorthand notation <code>n!</code>",
|
||||
"For example: <code>5! = 1 * 2 * 3 * 4 * 5 = 120</code>",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function factorialize(num) {",
|
||||
" return num;",
|
||||
"}",
|
||||
"",
|
||||
"factorialize(5);"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Arithmetic Operators"
|
||||
],
|
||||
"solutions": [
|
||||
"function factorialize(num) {\n return num < 1 ? 1 : num * factorialize(num-1);\n}\n\nfactorialize(5);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Factoriza un número",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva el factorial del número entero que se te provee",
|
||||
"El factorial de un número entero positivo n es la multiplicación de todos los enteros positivos menores o iguales a n",
|
||||
"Los factoriales son comúnmente representados con la notación <code>n!</code>",
|
||||
"Por ejemplo: <code>5! = 1 * 2 * 3 * 4 * 5 = 120</code>",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "aaa48de84e1ecc7c742e1124",
|
||||
"title": "Check for Palindromes",
|
||||
"description": [
|
||||
"Return true if the given string is a palindrome. Otherwise, return false.",
|
||||
"A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.",
|
||||
"You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything lower case in order to check for palindromes.",
|
||||
"We'll pass strings with varying formats, such as \"racecar\", \"RaceCar\", and \"race CAR\" among others.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof palindrome(\"eye\") === \"boolean\", 'message: <code>palindrome(\"eye\")</code> should return a boolean.');",
|
||||
"assert(palindrome(\"eye\") === true, 'message: <code>palindrome(\"eye\")</code> should return true.');",
|
||||
"assert(palindrome(\"race car\") === true, 'message: <code>palindrome(\"race car\")</code> should return true.');",
|
||||
"assert(palindrome(\"not a palindrome\") === false, 'message: <code>palindrome(\"not a palindrome\")</code> should return false.');",
|
||||
"assert(palindrome(\"A man, a plan, a canal. Panama\") === true, 'message: <code>palindrome(\"A man, a plan, a canal. Panama\")</code> should return true.');",
|
||||
"assert(palindrome(\"never odd or even\") === true, 'message: <code>palindrome(\"never odd or even\")</code> should return true.');",
|
||||
"assert(palindrome(\"nope\") === false, 'message: <code>palindrome(\"nope\")</code> should return false.');",
|
||||
"assert(palindrome(\"almostomla\") === false, 'message: <code>palindrome(\"almostomla\")</code> should return false.');",
|
||||
"assert(palindrome(\"My age is 0, 0 si ega ym.\") === true, 'message: <code>palindrome(\"My age is 0, 0 si ega ym.\")</code> should return true.');",
|
||||
"assert(palindrome(\"1 eye for of 1 eye.\") === false, 'message: <code>palindrome(\"1 eye for of 1 eye.\")</code> should return false.');",
|
||||
"assert(palindrome(\"0_0 (: /-\\ :) 0-0\") === true, 'message: <code>palindrome(\"0_0 (: /-\\ :) 0-0\")</code> should return true.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function palindrome(str) {",
|
||||
" // Good luck!",
|
||||
" return true;",
|
||||
"}",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"palindrome(\"eye\");"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.replace()",
|
||||
"String.toLowerCase()"
|
||||
],
|
||||
"solutions": [
|
||||
"function palindrome(str) {\n var string = str.toLowerCase().split(/[^A-Za-z0-9]/gi).join('');\n var aux = string.split('');\n if (aux.join('') === aux.reverse().join('')){\n return true;\n }\n\n return false;\n}"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Verifica si es palíndromo",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva true si una cadena de texto dada es un palíndromo, y que devuelva false en caso contrario",
|
||||
"Un palíndromo es una palabra u oración que se escribe de la misma forma en ambos sentidos, sin tomar en cuenta signos de puntuación, espacios y sin distinguir entre mayúsculas y minúsculas.",
|
||||
"Tendrás que quitar los signos de puntuación y transformar las letras a minúsculas para poder verificar si el texto es palíndromo.",
|
||||
"Te proveeremos textos en varios formatos, como \"racecar\", \"RaceCar\", and \"race CAR\" entre otros.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a26cbbe9ad8655a977e1ceb5",
|
||||
"title": "Find the Longest Word in a String",
|
||||
"description": [
|
||||
"Return the length of the longest word in the provided sentence.",
|
||||
"Your response should be a number.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function findLongestWord(str) {",
|
||||
" return str.length;",
|
||||
"}",
|
||||
"",
|
||||
"findLongestWord(\"The quick brown fox jumped over the lazy dog\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof findLongestWord(\"The quick brown fox jumped over the lazy dog\") === \"number\", 'message: <code>findLongestWord(\"The quick brown fox jumped over the lazy dog\")</code> should return a number.');",
|
||||
"assert(findLongestWord(\"The quick brown fox jumped over the lazy dog\") === 6, 'message: <code>findLongestWord(\"The quick brown fox jumped over the lazy dog\")</code> should return 6.');",
|
||||
"assert(findLongestWord(\"May the force be with you\") === 5, 'message: <code>findLongestWord(\"May the force be with you\")</code> should return 5.');",
|
||||
"assert(findLongestWord(\"Google do a barrel roll\") === 6, 'message: <code>findLongestWord(\"Google do a barrel roll\")</code> should return 6.');",
|
||||
"assert(findLongestWord(\"What is the average airspeed velocity of an unladen swallow\") === 8, 'message: <code>findLongestWord(\"What is the average airspeed velocity of an unladen swallow\")</code> should return 8.');",
|
||||
"assert(findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\") === 19, 'message: <code>findLongestWord(\"What if we try a super-long word such as otorhinolaryngology\")</code> should return 19.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.split()",
|
||||
"String.length"
|
||||
],
|
||||
"solutions": [
|
||||
"function findLongestWord(str) {\n return str.split(' ').sort(function(a, b) { return b.length - a.length;})[0].length;\n}\n\nfindLongestWord('The quick brown fox jumped over the lazy dog');\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Encuentra la palabra más larga",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva la longitud de la palabra más larga en una frase dada",
|
||||
"El resultado debe ser un número",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "ab6137d4e35944e21037b769",
|
||||
"title": "Title Case a Sentence",
|
||||
"description": [
|
||||
"Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.",
|
||||
"For the purpose of this exercise, you should also capitalize connecting words like \"the\" and \"of\".",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function titleCase(str) {",
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"titleCase(\"I'm a little tea pot\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof titleCase(\"I'm a little tea pot\") === \"string\", 'message: <code>titleCase(\"I'm a little tea pot\")</code> should return a string.');",
|
||||
"assert(titleCase(\"I'm a little tea pot\") === \"I'm A Little Tea Pot\", 'message: <code>titleCase(\"I'm a little tea pot\")</code> should return \"I'm A Little Tea Pot\".');",
|
||||
"assert(titleCase(\"sHoRt AnD sToUt\") === \"Short And Stout\", 'message: <code>titleCase(\"sHoRt AnD sToUt\")</code> should return \"Short And Stout\".');",
|
||||
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: <code>titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")</code> should return \"Here Is My Handle Here Is My Spout\".');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.charAt()"
|
||||
],
|
||||
"solutions": [
|
||||
"function titleCase(str) {\n return str.split(' ').map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();\n }).join(' ');\n}\n\ntitleCase(\"I'm a little tea pot\");\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Aplica formato de título",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva la cadena de texto dada con la primera letra de cada palabra en mayúscula. Asegúrate de que el resto de las letras sean minúsculas",
|
||||
"Para este ejercicio, también debes poner en mayúscula conectores como \"the\" y \"of\".",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a789b3483989747d63b0e427",
|
||||
"title": "Return Largest Numbers in Arrays",
|
||||
"description": [
|
||||
"Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.",
|
||||
"Remember, you can iterate through an array with a simple for loop, and access each member with array syntax arr[i] .",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function largestOfFour(arr) {",
|
||||
" // You can do this!",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]).constructor === Array, 'message: <code>largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return an array.');",
|
||||
"assert.deepEqual(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]), [27,5,39,1001], 'message: <code>largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])</code> should return <code>[27,5,39,1001]</code>.');",
|
||||
"assert.deepEqual(largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]]), [9,35,97,1000000], 'message: <code>largestOfFour([[4, 9, 1, 3], [13, 35, 18, 26], [32, 35, 97, 39], [1000000, 1001, 857, 1]])</code> should return <code>[9, 35, 97, 1000000]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Comparison Operators"
|
||||
],
|
||||
"solutions": [
|
||||
"function largestOfFour(arr) {\n return arr.map(function(subArr) {\n return Math.max.apply(null, subArr);\n });\n}\n\nlargestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Devuelve el entero mayor en cada arreglo",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva un arreglo que contenga el mayor de los números de cada sub-arreglo que se te presenta. Para simplificar las cosas, el arreglo que te presentamos tendrá exactamente 4 sub-arreglos",
|
||||
"Recuerda que puedes iterar a través de un arreglo con un búcle simple, y acceder a cada miembro utilizando la sintaxis arr[i].",
|
||||
"Si escribes tu propio test con Chai.js, asegúrate de utilizar un operador de igualdad estricto en lugar de un operador de igualdad cuando compares arreglos. ",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "acda2fb1324d9b0fa741e6b5",
|
||||
"title": "Confirm the Ending",
|
||||
"description": [
|
||||
"Check if a string (first argument) ends with the given target string (second argument).",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function end(str, target) {",
|
||||
" // \"Never give up and good luck will find you.\"",
|
||||
" // -- Falcor",
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"end(\"Bastian\", \"n\");"
|
||||
],
|
||||
"tests": [
|
||||
"assert(end(\"Bastian\", \"n\") === true, 'message: <code>end(\"Bastian\", \"n\")</code> should return true.');",
|
||||
"assert(end(\"Connor\", \"n\") === false, 'message: <code>end(\"Connor\", \"n\")</code> should return false.');",
|
||||
"assert(end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\") === false, 'message: <code>end(\"Walking on water and developing software from a specification are easy if both are frozen\", \"specification\")</code> should return false.');",
|
||||
"assert(end(\"He has to give me a new name\", \"name\") === true, 'message: <code>end(\"He has to give me a new name\", \"name\")</code> should return true.');",
|
||||
"assert(end(\"He has to give me a new name\", \"me\") === true, 'message: <code>end(\"He has to give me a new name\", \"me\")</code> should return true.');",
|
||||
"assert(end(\"He has to give me a new name\", \"na\") === false, 'message: <code>end(\"He has to give me a new name\", \"na\")</code> should return false.');",
|
||||
"assert(end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\") === false, 'message: <code>end(\"If you want to save our world, you must hurry. We dont know how much longer we can withstand the nothing\", \"mountain\")</code> should return false.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.substr()"
|
||||
],
|
||||
"solutions": [
|
||||
"function end(str, target) {\n return str.substring(str.length-target.length) === target;\n};\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Confirma la terminación",
|
||||
"descriptionEs": [
|
||||
"Verifica si una cadena de texto (primer argumento) termina con una cadena de texto dada (segundo argumento).",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string",
|
||||
"description": [
|
||||
"Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function repeat(str, num) {",
|
||||
" // repeat after me",
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"repeat(\"abc\", 3);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(repeat(\"*\", 3) === \"***\", 'message: <code>repeat(\"*\", 3)</code> should return <code>\"***\"</code>.');",
|
||||
"assert(repeat(\"abc\", 3) === \"abcabcabc\", 'message: <code>repeat(\"abc\", 3)</code> should return <code>\"abcabcabc\"</code>.');",
|
||||
"assert(repeat(\"abc\", 4) === \"abcabcabcabc\", 'message: <code>repeat(\"abc\", 4)</code> should return <code>\"abcabcabcabc\"</code>.');",
|
||||
"assert(repeat(\"abc\", 1) === \"abc\", 'message: <code>repeat(\"abc\", 1)</code> should return <code>\"abc\"</code>.');",
|
||||
"assert(repeat(\"*\", 8) === \"********\", 'message: <code>repeat(\"*\", 8)</code> should return <code>\"********\"</code>.');",
|
||||
"assert(repeat(\"abc\", -2) === \"\", 'message: <code>repeat(\"abc\", -2)</code> should return <code>\"\"</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Global String Object"
|
||||
],
|
||||
"solutions": [
|
||||
"function repeat(str, num) {\n if (num < 0) return '';\n return num === 1 ? str : str + repeat(str, num-1);\n}\n\nrepeat('abc', 3);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Repite el texto Repite el texto",
|
||||
"descriptionEs": [
|
||||
"Repite una cadena de texto dada (primer argumento) n veces (segundo argumento). Devuelve una cadena de texto vacía si n es un número negativo.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "ac6993d51946422351508a41",
|
||||
"title": "Truncate a string",
|
||||
"description": [
|
||||
"Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a \"...\" ending.",
|
||||
"Note that the three dots at the end add to the string length.",
|
||||
"If the <code>num</code> is less than or equal to 3, then the length of the three dots is not added to the string length.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function truncate(str, num) {",
|
||||
" // Clear out that junk in your trunk",
|
||||
" return str;",
|
||||
"}",
|
||||
"",
|
||||
"truncate(\"A-tisket a-tasket A green and yellow basket\", 11);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", 11) === \"A-tisket...\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", 11)</code> should return \"A-tisket...\".');",
|
||||
"assert(truncate(\"Peter Piper picked a peck of pickled peppers\", 14) === \"Peter Piper...\", 'message: <code>truncate(\"Peter Piper picked a peck of pickled peppers\", 14)</code> should return \"Peter Piper...\".');",
|
||||
"assert(truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length) === \"A-tisket a-tasket A green and yellow basket\", 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length)</code> should return \"A-tisket a-tasket A green and yellow basket\".');",
|
||||
"assert(truncate('A-tisket a-tasket A green and yellow basket', 'A-tisket a-tasket A green and yellow basket'.length + 2) === 'A-tisket a-tasket A green and yellow basket', 'message: <code>truncate(\"A-tisket a-tasket A green and yellow basket\", \"A-tisket a-tasket A green and yellow basket\".length + 2)</code> should return \"A-tisket a-tasket A green and yellow basket\".');",
|
||||
"assert(truncate(\"A-\", 1) === \"A...\", 'message: <code>truncate(\"A-\", 1)</code> should return \"A...\".');",
|
||||
"assert(truncate(\"Absolutely Longer\", 2) === \"Ab...\", 'message: <code>truncate(\"Absolutely Longer\", 2)</code> should return \"Ab...\".');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.slice()"
|
||||
],
|
||||
"solutions": [
|
||||
"function truncate(str, num) {\n if(str.length > num ) {\n if(num > 3) {\n return str.slice(0, num - 3) + '...';\n } else {\n return str.slice(0,num) + '...';\n }\n } \n return str;\n}"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Trunca una cadena de texto",
|
||||
"descriptionEs": [
|
||||
"Trunca una cadena de texto (primer argumento) si su longitud es mayor que un máximo de caracteres dado (segundo argumento). Devuelve la cadena de texto truncada con una terminación \"...\".",
|
||||
"Ten en cuenta que los tres puntos al final también se cuentan dentro de la longitud de la cadena de texto.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a9bd25c716030ec90084d8a1",
|
||||
"title": "Chunky Monkey",
|
||||
"description": [
|
||||
"Write a function that splits an array (first argument) into groups the length of <code>size</code> (second argument) and returns them as a multidimensional array.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function chunk(arr, size) {",
|
||||
" // Break it up.",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"chunk([\"a\", \"b\", \"c\", \"d\"], 2);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(chunk([\"a\", \"b\", \"c\", \"d\"], 2), [[\"a\", \"b\"], [\"c\", \"d\"]], 'message: <code>chunk([\"a\", \"b\", \"c\", \"d\"], 2)</code> should return <code>[[\"a\", \"b\"], [\"c\", \"d\"]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 3), [[0, 1, 2], [3, 4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 3)</code> should return <code>[[0, 1, 2], [3, 4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 2), [[0, 1], [2, 3], [4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 2)</code> should return <code>[[0, 1], [2, 3], [4, 5]]</code>.');",
|
||||
"assert.deepEqual(chunk([0, 1, 2, 3, 4, 5], 4), [[0, 1, 2, 3], [4, 5]], 'message: <code>chunk([0, 1, 2, 3, 4, 5], 4)</code> should return <code>[[0, 1, 2, 3], [4, 5]]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.push()"
|
||||
],
|
||||
"solutions": [
|
||||
"function chunk(arr, size) {\n var out = [];\n for (var i = 0; i < arr.length; i+=size) {\n out.push(arr.slice(i,i+size));\n }\n return out;\n}\n\nchunk(['a', 'b', 'c', 'd'], 2);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "En mil pedazos",
|
||||
"descriptionEs": [
|
||||
"Escribe una función que parta un arreglo (primer argumento) en fragmentos de una longitud dada (segundo argumento) y los devuelva en forma de un arreglo multidimensional.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "ab31c21b530c0dafa9e241ee",
|
||||
"title": "Slasher Flick",
|
||||
"description": [
|
||||
"Return the remaining elements of an array after chopping off n elements from the head.",
|
||||
"The head meaning the beginning of the array, or the zeroth index",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function slasher(arr, howMany) {",
|
||||
" // it doesn't always pay to be first",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"slasher([1, 2, 3], 2);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(slasher([1, 2, 3], 2), [3], 'message: <code>slasher([1, 2, 3], 2)</code> should return <code>[3]</code>.');",
|
||||
"assert.deepEqual(slasher([1, 2, 3], 0), [1, 2, 3], 'message: <code>slasher([1, 2, 3], 0)</code> should return <code>[1, 2, 3]</code>.');",
|
||||
"assert.deepEqual(slasher([1, 2, 3], 9), [], 'message: <code>slasher([1, 2, 3], 9)</code> should return <code>[]</code>.');",
|
||||
"assert.deepEqual(slasher([1, 2, 3], 4), [], 'message: <code>slasher([1, 2, 3], 4)</code> should return <code>[]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.slice()",
|
||||
"Array.splice()"
|
||||
],
|
||||
"solutions": [
|
||||
"function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr.slice(howMany);\n}\n\nslasher([1, 2, 3], 2);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Vuélale la cabeza",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva los elementos restantes de un arreglo después de eliminar n elementos de la cabeza.",
|
||||
"Por cabeza nos referimos al inicio de un arreglo, comenzando por el índice 0.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "af2170cad53daa0770fabdea",
|
||||
"title": "Mutations",
|
||||
"description": [
|
||||
"Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.",
|
||||
"For example, <code>[\"hello\", \"Hello\"]</code>, should return true because all of the letters in the second string are present in the first, ignoring case.",
|
||||
"The arguments <code>[\"hello\", \"hey\"]</code> should return false because the string \"hello\" does not contain a \"y\".",
|
||||
"Lastly, <code>[\"Alien\", \"line\"]</code>, should return true because all of the letters in \"line\" are present in \"Alien\".",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function mutation(arr) {",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"mutation([\"hello\", \"hey\"]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert(mutation([\"hello\", \"hey\"]) === false, 'message: <code>mutation([\"hello\", \"hey\"])</code> should return false.');",
|
||||
"assert(mutation([\"hello\", \"Hello\"]) === true, 'message: <code>mutation([\"hello\", \"Hello\"])</code> should return true.');",
|
||||
"assert(mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"]) === true, 'message: <code>mutation([\"zyxwvutsrqponmlkjihgfedcba\", \"qrstu\"])</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Army\"]) === true, 'message: <code>mutation([\"Mary\", \"Army\"])</code> should return true.');",
|
||||
"assert(mutation([\"Mary\", \"Aarmy\"]) === true, 'message: <code>mutation([\"Mary\", \"Aarmy\"])</code> should return true.');",
|
||||
"assert(mutation([\"Alien\", \"line\"]) === true, 'message: <code>mutation([\"Alien\", \"line\"])</code> should return true.');",
|
||||
"assert(mutation([\"floor\", \"for\"]) === true, 'message: <code>mutation([\"floor\", \"for\"])</code> should return true.');",
|
||||
"assert(mutation([\"hello\", \"neo\"]) === false, 'message: <code>mutation([\"hello\", \"neo\"])</code> should return false.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"String.indexOf()"
|
||||
],
|
||||
"solutions": [
|
||||
"function mutation(arr) {\n var hash = Object.create(null);\n arr[0].toLowerCase().split('').forEach(function(c) {\n hash[c] = true;\n });\n return !arr[1].toLowerCase().split('').filter(function(c) {\n return !hash[c];\n }).length;\n}\n\nmutation(['hello', 'hey']);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Mutaciones",
|
||||
"descriptionEs": [
|
||||
"Crea una función que devuelva true si la cadena de texto en el primer elemento de un arreglo contiene todas las letras de la cadena de texto en el segundo elemento del arreglo.",
|
||||
"Por ejemplo, <code>[\"hello\", \"Hello\"]</code>, debe devolver true porque todas las letras en la segunda cadena de texto están presentes en la primera, sin distinguir entre mayúsculas y minúsculas.",
|
||||
"En el caso de <code>[\"hello\", \"hey\"]</code> la función debe devolver false porque la cadena de texto \"hello\" no contiene una \"y\".",
|
||||
"Finalmente, <code>[\"Alien\", \"line\"]</code>, la función debe devolver true porque todas las letras en \"line\" están presentes en \"Alien\".",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "adf08ec01beb4f99fc7a68f2",
|
||||
"title": "Falsy Bouncer",
|
||||
"description": [
|
||||
"Remove all falsy values from an array.",
|
||||
"Falsy values in javascript are <code>false</code>, <code>null</code>, <code>0</code>, <code>\"\"</code>, <code>undefined</code>, and <code>NaN</code>.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function bouncer(arr) {",
|
||||
" // Don't show a false ID to this bouncer.",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"bouncer([7, \"ate\", \"\", false, 9]);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(bouncer([7, \"ate\", \"\", false, 9]), [7, \"ate\", 9], 'message: <code>bouncer([7, \"ate\", \"\", false, 9])</code> should return <code>[7, \"ate\", 9]</code>.');",
|
||||
"assert.deepEqual(bouncer([\"a\", \"b\", \"c\"]), [\"a\", \"b\", \"c\"], 'message: <code>bouncer([\"a\", \"b\", \"c\"])</code> should return <code>[\"a\", \"b\", \"c\"]</code>.');",
|
||||
"assert.deepEqual(bouncer([false, null, 0, NaN, undefined, \"\"]), [], 'message: <code>bouncer([false, null, 0, NaN, undefined, \"\"])</code> should return <code>[]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Boolean Objects",
|
||||
"Array.filter()"
|
||||
],
|
||||
"solutions": [
|
||||
"function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n return arr.filter(function(e) {return e;});\n}\n\nbouncer([7, 'ate', '', false, 9]);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Detector de mentiras",
|
||||
"descriptionEs": [
|
||||
"Remueve todos los valores falsy de un arreglo dado",
|
||||
"En javascript, valores falsy son los siguientes: <code>false</code>, <code>null</code>, <code>0</code>, <code>\"\"</code>, <code>undefined</code>, y <code>NaN</code>.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||
"title": "Seek and Destroy",
|
||||
"description": [
|
||||
"You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function destroyer(arr) {",
|
||||
" // Remove all the values",
|
||||
" return arr;",
|
||||
"}",
|
||||
"",
|
||||
"destroyer([1, 2, 3, 1, 2, 3], 2, 3);"
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1], 'message: <code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code> should return <code>[1, 1]</code>.');",
|
||||
"assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1], 'message: <code>destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)</code> should return <code>[1, 5, 1]</code>.');",
|
||||
"assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1], 'message: <code>destroyer([3, 5, 1, 2, 2], 2, 3, 5)</code> should return <code>[1]</code>.');",
|
||||
"assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), [], 'message: <code>destroyer([2, 3, 2, 3], 2, 3)</code> should return <code>[]</code>.');",
|
||||
"assert.deepEqual(destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53), [\"hamburger\"], 'message: <code>destroyer([\"tree\", \"hamburger\", 53], \"tree\", 53)</code> should return <code>[\"hamburger\"]</code>.');"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Arguments object",
|
||||
"Array.filter()"
|
||||
],
|
||||
"solutions": [
|
||||
"function destroyer(arr) {\n var hash = Object.create(null);\n [].slice.call(arguments, 1).forEach(function(e) {\n hash[e] = true;\n });\n // Remove all the values\n return arr.filter(function(e) { return !(e in hash);});\n}\n\ndestroyer([1, 2, 3, 1, 2, 3], 2, 3);\n"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Buscar y destruir",
|
||||
"descriptionEs": [
|
||||
"Se te proveerá un arreglo inicial (el primer argumento en la función destroyer), seguido por uno o más argumentos. Elimina todos los elementos del arreglo inicial que tengan el mismo valor que el resto de argumentos.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong",
|
||||
"description": [
|
||||
"Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.",
|
||||
"For example, <code>where([1,2,3,4], 1.5)</code> should return <code>1</code> because it is greater than <code>1</code> (index 0), but less than <code>2</code> (index 1).",
|
||||
"Likewise, <code>where([20,3,5], 19)</code> should return <code>2</code> because once the array has been sorted it will look like <code>[3,5,20]</code> and <code>19</code> is less than <code>20</code> (index 2) and greater than <code>5</code> (index 1).",
|
||||
"Remember to use <a href=\"//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck\" target=\"_blank\">Read-Search-Ask</a> if you get stuck. Write your own code."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"function where(arr, num) {",
|
||||
" // Find my place in this sorted array.",
|
||||
" return num;",
|
||||
"}",
|
||||
"",
|
||||
"where([40, 60], 50);"
|
||||
],
|
||||
"MDNlinks": [
|
||||
"Array.sort()"
|
||||
],
|
||||
"solutions": [
|
||||
"function where(arr, num) {\n arr = arr.sort(function(a, b){return a-b;});\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] >= num)\n {\n return i;\n }\n }\n return arr.length;\n}"
|
||||
],
|
||||
"tests": [
|
||||
"assert(where([10, 20, 30, 40, 50], 35) === 3, 'message: <code>where([10, 20, 30, 40, 50], 35)</code> should return <code>3</code>.');",
|
||||
"assert(where([10, 20, 30, 40, 50], 30) === 2, 'message: <code>where([10, 20, 30, 40, 50], 30)</code> should return <code>2</code>.');",
|
||||
"assert(where([40, 60], 50) === 1, 'message: <code>where([40, 60,], 50)</code> should return <code>1</code>.');",
|
||||
"assert(where([3, 10, 5], 3) === 0, 'message: <code>where([3, 10, 5], 3)</code> should return <code>0</code>.');",
|
||||
"assert(where([5, 3, 20, 3], 5) === 2, 'message: <code>where([5, 3, 20, 3], 5)</code> should return <code>2</code>.');",
|
||||
"assert(where([2, 20, 10], 19) === 2, 'message: <code>where([2, 20, 10], 19)</code> should return <code>2</code>.');",
|
||||
"assert(where([2, 5, 10], 15) === 3, 'message: <code>where([2, 5, 10], 15)</code> should return <code>3</code>.');"
|
||||
],
|
||||
"type": "bonfire",
|
||||
"challengeType": 5,
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "¿Cuál es mi asiento?",
|
||||
"descriptionEs": [
|
||||
"Devuelve el menor índice en el que un valor (segundo argumento) debe ser insertado en un arreglo ordenado (primer argumento).",
|
||||
"Por ejemplo, where([1,2,3,4], 1.5) debe devolver 1 porque el segundo argumento de la función (1.5) es mayor que 1 (con índice 0 en el arreglo), pero menor que 2 (con índice 1).",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado. Intenta programar en pareja. Escribe tu propio código."
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,312 @@
|
||||
{
|
||||
"name": "Basic Front End Development Projects",
|
||||
"order": 9,
|
||||
"time": "100h",
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||
"title": "Get Set for Ziplines",
|
||||
"challengeSeed": [],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/OAD6SJz.png",
|
||||
"An image of a Simon game, one our Zipline projects.",
|
||||
"Ziplines are front end development projects that will give you a chance to apply the front end skills you've developed up to this point. We'll use a popular browser-based code editor called CodePen.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/WBetuBa.jpg",
|
||||
"A programmer punching through his laptop screen in frustration.",
|
||||
"Ziplines are hard. It takes most campers several days to build each Zipline. You will get frustrated. But don't quit. This gets easier with practice.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/6WLULsC.gif",
|
||||
"A gif showing how to create a Codepen account.",
|
||||
"For our front end Zipline challenges, we'll use a popular browser-based code editor called CodePen. Open CodePen and click \"Sign up\" in the upper right hand corner, then scroll down to the free plan and click \"Sign up\" again. Click the \"Use info from GitHub button\", then add your email address and create a password. Click the \"Sign up\" button. Then in the upper right hand corner, click \"New pen\".",
|
||||
"http://codepen.io"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/U4y9RJ1.gif",
|
||||
"A gif showing that you can type \"hello world\" will output \"hello world\" in the preview window. You can also drag windows to resize them, and change their orientation.",
|
||||
"In the HTML box, create an h1 element with the text \"Hello World\". You can drag the frames around to resize them. You can also click the \"Change View\" button and change the orientation of the frames.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/G9KFQDL.gif",
|
||||
"A gif showing the process of adding Bootstrap to your pen.",
|
||||
"Click the gear in the upper left hand corner of the CSS box, then scroll down to \"Quick add\" and choose Bootstrap. Now give your h1 element the class of \"text-primary\" to change its color and prove that Bootstrap is now available.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/Gi3aig0.gif",
|
||||
"A gif showing the process of adding Animate.css and jQuery to pen.",
|
||||
"Click the gear in the upper left hand corner of the CSS box, then scroll down to \"Quick add\" and choose Animate.css. Click the gear in the upper left hand corner of the JS box, then scroll down to \"Quick add\" and choose jQuery. Let's prove that Animate.css and jQuery are loaded properly. In the JS box, add the following code to make your h1 element bounce: <code>$(document).ready(function(){ $(\"h1\").addClass(\"animated bounce\"); });</code>.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/Wzt6Y9Y.gif",
|
||||
"A gif showing the process of saving and forking a pen.",
|
||||
"Save your pen with the \"Save\" button. Then click the \"Fork\" button. This will create a fork (copy) of your pen that you can experiment with.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Prepárate para los Ziplines",
|
||||
"descriptionEs": [
|
||||
[
|
||||
"http://i.imgur.com/6WLULsC.gif",
|
||||
"Un gif que muestra cómo crear una cuenta en Codepen.",
|
||||
"Para nuestros desafíos de front end, los Ziplines, usaremos un editor muy famoso llamado Codepen, el cual es completamente basado en el navegador. Abre CodePen y pulsa en \"Sign up\" en la esquina superior derecha, luego ve hacia abajo donde se encuentra el plan gratuito (free plan) y pulsa en \"Sign up\". Da clic en el botón que dice \"Use info from GitHub\", luego agrega tu dirección de correo electrónico y crea una contraseña. Pulsa el botón que dice \"Sign up\". Luego, en la esquina superior derecha , da clic en \"New pen\".",
|
||||
"http://codepen.io"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/U4y9RJ1.gif",
|
||||
"Un gif que muestra que puedes escribir \"hello world\" en el editor, lo cual escribirá \"hello world\" en la ventana de vista previa. También puedes mover las ventanas para cambiar su tamaño, y cambiar su orientación.",
|
||||
"En la ventana de HTML, crea un elemento h1 con el texto \"Hola mundo\". Puedes arrastrar los bordes de las ventanas para cambiar su tamaño. Tambiénn puedes pulsar el botón de \"Change View\" para cambiar la orientación de las ventanas.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/G9KFQDL.gif",
|
||||
"Un gif que muestra el proceso de agregar Bootstrap a tu proyecto.",
|
||||
"Pulsa el engrane en la esquina superior izquierda de la ventana de CSS, luego ve hacia abajo hasta donde dice \"Quick add\" y elige Bootstrap. Ahora dale a tu elemento h1 la clase \"text-primary\" para cambiar su color y verificar que Bootstrap está activado.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/Gi3aig0.gif",
|
||||
"Un gif que muestra el proceso de agregar Animate.css y jQuery a tu proyecto.",
|
||||
"Pulsa el engrane en la esquina superior izquierda de la ventana de CSS, luego ve hacia abajo hasta donde dice \"Quick add\" y elige Animate.css. Haz clic en el engrane en la esquina superior izquierda de la ventana de JS, luego ve hacia abajo hasta donde dice \"Quick add\" y elige jQuery. Provemos que Animate.css y jQuery se cargaron propiamente. En la ventana de JS, agrega el siguiente código para hacer tu elemento h1 rebotar: <code>$(document).ready(function(){ $(\"h1\").addClass(\"animated bounce\"); });</code>.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/Wzt6Y9Y.gif",
|
||||
"Un gif que muestra el proceso de guardar y bifurcar un proyecto.",
|
||||
"Guarda tu proyecto con el botón \"Save\". Luego pulsa el botón de \"Fork\". Esto crea una bifurcación (copia) de tu proyecto con la que puedes experimentar.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c242eddfaeb5bd13",
|
||||
"title": "Build a Personal Portfolio Webpage",
|
||||
"challengeSeed": ["133315782"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can access all of the portfolio webpage's content just by scrolling.",
|
||||
"<span class='text-info'>User Story:</span> I can click different buttons that will take me to the portfolio creator's different social media pages.",
|
||||
"<span class='text-info'>User Story:</span> I can see thumbnail images of different projects the portfolio creator has built (if you haven't built any websites before, use placeholders.)",
|
||||
"<span class='text-info'>User Story:</span> I navigate to different sections of the webpage by clicking buttons in the navigation.",
|
||||
"Don't worry if you don't have anything to showcase on your portfolio yet - you will build several apps on the next few CodePen challenges, and can come back and update your portfolio later.",
|
||||
"There are many great portfolio templates out there, but for this challenge, you'll need to build a portfolio page yourself. Using Bootstrap will make this much easier for you.",
|
||||
"Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jQuery, you will need to target invisible anchor elements like this one: <code><a target='_blank'></a></code>.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Создайте сайт-портфолио",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"<span class='text-info'>Подсказка:</span> Если вы не хотите создавать портфолио с нуля, можете взять за основу этот простой Bootstrap шаблон: <a href='http://codepen.io/FreeCodeCamp/pen/mJNqQj/' target='_blank'>http://codepen.io/FreeCodeCamp/pen/mJNqQj</a>.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу получить доступ ко всей информации на странице просто прокрутив ее сверху вниз.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу нажать на различные кнопки и перейти к социальным страницам владельца портфолио.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть эскизы проектов, которые были созданы владельцем портфолио (используйте временную картинку если у вас пока нету собственных веб-страниц).",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу перемещаться к различным частям страницы нажимая на соответствующие навигационные кнопки.",
|
||||
"Не переживайте если вам пока нечего показать в портфолио - вы создадите несколько веб приложений в следующих заданиях, а затем вернетесь и обновите портфолио.",
|
||||
"В сети существует много шаблонов для портфолио, но в этом задании вам необходимо создать собственную уникальную страницу. Использование Bootstrap сделает этот процесс намного проще.",
|
||||
"Обратите внимание, что CodePen.io переопределяет функцию Window.open(), поэтому, если вы хотите открывать окна используя jQuery, необходимо будет адресовать невидимые якорные элементы, такие как этот: <code><a target='_blank'&rt;</a></code>.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "Construye una página web para tu portafolio",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/ThiagoFerreir4/full/eNMxEp' target='_blank'>http://codepen.io/ThiagoFerreir4/full/eNMxEp</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"<span class='text-info'>Pista:</span> Si no quieres iniciar desde cero, puedes bifurcar (fork) la siguiente plantilla simple de Bootstrap en CodePen: <a href='http://codepen.io/FreeCodeCamp/pen/mJNqQj/' target='_blank'>http://codepen.io/FreeCodeCamp/pen/mJNqQj</a>.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo acceder a todo el contenido de la página del portafolio con sólo desplazarme en la ventana.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo pulsar diferentes botones que me llevarán a las páginas de las diferentes cuentas de redes sociales del creador.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo ver una imagen de los diferentes proyectos que el creador del portafolio ha construido (si no has construido ningún sitio web antes, usa placeholders.)",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo navegar a las diferentes secciones de la página web pulsando botones de navegación.",
|
||||
"No te preocupes si no tienes nada que mostrar en tu portafolio todavía - en los siguientes desafíos crearás varias apps en CodePen, así que puedes regresar luego para actualizar tu portafolio.",
|
||||
"Hay varias buenas plantillas, pero para este desafío, tendrás que construir la página web de tu portafolio completamente por tu cuenta. Usar Bootstrap hará el trabajo mucho más fácil para ti.",
|
||||
"Ten en mente que CodePen.io ignora la función Window.open(), así que si quieres abrir alguna ventana usando jQuery, necesitarás utilizar como objetivo un elemento de ancla invisible como el siguiente: <code><a target='_blank'></a></code>.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd13",
|
||||
"title": "Build a Random Quote Machine",
|
||||
"challengeSeed": ["126415122"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can click a button to show me a new random quote.",
|
||||
"<span class='text-info'>User Story:</span> I can press a button to tweet out a quote.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Создайте генератор случайных цитат",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку и получить случайную цитату.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку и опубликовать цитату в Twitter'e.",
|
||||
"Цитаты можно добавить в массив и случайным образом выводить одну из них, либо можно воспользоваться соответствующим API, например <a href='http://forismatic.com/en/api/'>http://forismatic.com/en/api/</a>.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "Crea una máquina de frases aleatorias",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/AdventureBear/full/vEoVMw' target='_blank'>http://codepen.io/AdventureBear/full/vEoVMw</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo pulsar un botón que me mostrará una nueva frase aleatoria.",
|
||||
"<span class='text-info'>Bonus User Story:</span> Como usuario, puedo presionar un botón para twitear una frase.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd0f",
|
||||
"title": "Build a Pomodoro Clock",
|
||||
"challengeSeed": ["126411567"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/GeoffStorbeck/full/RPbGxZ/' target='_blank'>http://codepen.io/GeoffStorbeck/full/RPbGxZ/</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can start a 25 minute pomodoro, and the timer will go off once 25 minutes has elapsed.",
|
||||
"<span class='text-info'>User Story:</span> I can reset the clock for my next pomodoro.",
|
||||
"<span class='text-info'>User Story:</span> I can customize the length of each pomodoro.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Создайте таймер Pomodoro",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/RPbGxZ/' target='_blank'>http://codepen.io/GeoffStorbeck/full/RPbGxZ/</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу запустить 25 минутную 'помидорку', по истечении которой таймер выключится.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу сбросить таймер для установки следующей 'помидорки'.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу выбирать длительность 'помидорки'.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "Crea un reloj pomodoro",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/GeoffStorbeck/full/RPbGxZ/' target='_blank'>http://codepen.io/GeoffStorbeck/full/RPbGxZ/</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo iniciar un pomodoro de 25 minutos, y el cronómetro terminará cuando pasen 25 minutos.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo reiniciar el reloj para comenzar mi siguiente pomodoro.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo personalizar la longitud de cada pomodoro.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator",
|
||||
"challengeSeed": ["126411565"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/GeoffStorbeck/full/zxgaqw' target='_blank'>http://codepen.io/GeoffStorbeck/full/zxgaqw</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can add, subtract, multiply and divide two numbers.",
|
||||
"<span class='text-info'>User Story:</span> I can clear the input field with a clear button.",
|
||||
"<span class='text-info'>User Story:</span> I can keep chaining mathematical operations together until I hit the equal button, and the calculator will tell me the correct output.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Crea una calculadora JavaScript",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/GeoffStorbeck/full/zxgaqw' target='_blank'>http://codepen.io/GeoffStorbeck/full/zxgaqw</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo sumar, restar, multiplicar y dividir dos números.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Puedo limpiar la pantalla con un botón de borrar.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Puedo concatenar continuamente varias operaciones hasta que pulse el botón de igual, y la calculadora me mostrará la respuesta correcta.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
2303
challenges/01-front-end-development-certification/bootstrap.json
Normal file
2303
challenges/01-front-end-development-certification/bootstrap.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,275 @@
|
||||
{
|
||||
"name": "Claim Your Front End Development Certificate",
|
||||
"order": 12,
|
||||
"time": "5m",
|
||||
"challenges": [
|
||||
{
|
||||
"id": "561add10cb82ac38a17513be",
|
||||
"title": "Claim Your Front End Development Certificate",
|
||||
"challengeSeed": [
|
||||
{
|
||||
"properties": ["isHonest", "isFrontEndCert"],
|
||||
"apis": ["/certificate/honest", "/certificate/verify/front-end"],
|
||||
"stepIndex": [1, 2]
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
[
|
||||
"http://i.imgur.com/syJxavV.jpg",
|
||||
"An image of our Front End Development Certificate",
|
||||
"This challenge will give you your verified Front End Development Certificate. Before we issue your certificate, we must verify that you have completed all of our basic and intermediate Bonfires, and all our basic and intermediate Ziplines. You must also accept our Academic Honesty Pledge. Click the button below to start this process.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/HArFfMN.jpg",
|
||||
"The definition of plagiarism: Plagiarism (noun) - copying someone else’s work and presenting it as your own without crediting them",
|
||||
"By clicking below, you pledge that all of your submitted code A) is code you or your pair personally wrote, or B) comes from open source libraries like jQuery, or C) has been clearly attributed to its original authors. You also give us permission to audit your challenge solutions and revoke your certificate if we discover evidence of plagiarism.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/14F2Van.jpg",
|
||||
"An image of the text \"Front End Development Certificate requirements\"",
|
||||
"Let's confirm that you have completed all of our basic and intermediate Bonfires, and all our basic and intermediate Ziplines. Click the button below to verify this.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/16SIhHO.jpg",
|
||||
"An image of the word \"Congratulations\"",
|
||||
"Congratulations! We've added your Front End Development Certificate to your certificate to your portfolio page. Unless you choose to hide your solutions, this certificate will remain publicly visible and verifiable.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"type": "Waypoint",
|
||||
"challengeType": 7,
|
||||
"tests": [
|
||||
{
|
||||
"id": "ad7123c8c441eddfaeb5bdef",
|
||||
"title": "Meet Bonfire"
|
||||
},
|
||||
{
|
||||
"id": "a202eed8fc186c8434cb6d61",
|
||||
"title": "Reverse a String"
|
||||
},
|
||||
{
|
||||
"id": "a302f7aae1aa3152a5b413bc",
|
||||
"title": "Factorialize a Number"
|
||||
},
|
||||
{
|
||||
"id": "aaa48de84e1ecc7c742e1124",
|
||||
"title": "Check for Palindromes"
|
||||
},
|
||||
{
|
||||
"id": "a26cbbe9ad8655a977e1ceb5",
|
||||
"title": "Find the Longest Word in a String"
|
||||
},
|
||||
{
|
||||
"id": "ab6137d4e35944e21037b769",
|
||||
"title": "Title Case a Sentence"
|
||||
},
|
||||
{
|
||||
"id": "a789b3483989747d63b0e427",
|
||||
"title": "Return Largest Numbers in Arrays"
|
||||
},
|
||||
{
|
||||
"id": "acda2fb1324d9b0fa741e6b5",
|
||||
"title": "Confirm the Ending"
|
||||
},
|
||||
{
|
||||
"id": "afcc8d540bea9ea2669306b6",
|
||||
"title": "Repeat a string repeat a string"
|
||||
},
|
||||
{
|
||||
"id": "ac6993d51946422351508a41",
|
||||
"title": "Truncate a string"
|
||||
},
|
||||
{
|
||||
"id": "a9bd25c716030ec90084d8a1",
|
||||
"title": "Chunky Monkey"
|
||||
},
|
||||
{
|
||||
"id": "ab31c21b530c0dafa9e241ee",
|
||||
"title": "Slasher Flick"
|
||||
},
|
||||
{
|
||||
"id": "af2170cad53daa0770fabdea",
|
||||
"title": "Mutations"
|
||||
},
|
||||
{
|
||||
"id": "adf08ec01beb4f99fc7a68f2",
|
||||
"title": "Falsy Bouncer"
|
||||
},
|
||||
{
|
||||
"id": "a39963a4c10bc8b4d4f06d7e",
|
||||
"title": "Seek and Destroy"
|
||||
},
|
||||
{
|
||||
"id": "a24c1a4622e3c05097f71d67",
|
||||
"title": "Where do I belong"
|
||||
},
|
||||
{
|
||||
"id": "a3566b1109230028080c9345",
|
||||
"title": "Sum All Numbers in a Range"
|
||||
},
|
||||
{
|
||||
"id": "a5de63ebea8dbee56860f4f2",
|
||||
"title": "Diff Two Arrays"
|
||||
},
|
||||
{
|
||||
"id": "a7f4d8f2483413a6ce226cac",
|
||||
"title": "Roman Numeral Converter"
|
||||
},
|
||||
{
|
||||
"id": "a8e512fbe388ac2f9198f0fa",
|
||||
"title": "Where art thou"
|
||||
},
|
||||
{
|
||||
"id": "a0b5010f579e69b815e7c5d6",
|
||||
"title": "Search and Replace"
|
||||
},
|
||||
{
|
||||
"id": "aa7697ea2477d1316795783b",
|
||||
"title": "Pig Latin"
|
||||
},
|
||||
{
|
||||
"id": "afd15382cdfb22c9efe8b7de",
|
||||
"title": "DNA Pairing"
|
||||
},
|
||||
{
|
||||
"id": "af7588ade1100bde429baf20",
|
||||
"title": "Missing letters"
|
||||
},
|
||||
{
|
||||
"id": "a77dbc43c33f39daa4429b4f",
|
||||
"title": "Boo who"
|
||||
},
|
||||
{
|
||||
"id": "a105e963526e7de52b219be9",
|
||||
"title": "Sorted Union"
|
||||
},
|
||||
{
|
||||
"id": "a6b0bb188d873cb2c8729495",
|
||||
"title": "Convert HTML Entities"
|
||||
},
|
||||
{
|
||||
"id": "a103376db3ba46b2d50db289",
|
||||
"title": "Spinal Tap Case"
|
||||
},
|
||||
{
|
||||
"id": "a5229172f011153519423690",
|
||||
"title": "Sum All Odd Fibonacci Numbers"
|
||||
},
|
||||
{
|
||||
"id": "a3bfc1673c0526e06d3ac698",
|
||||
"title": "Sum All Primes"
|
||||
},
|
||||
{
|
||||
"id": "ae9defd7acaf69703ab432ea",
|
||||
"title": "Smallest Common Multiple"
|
||||
},
|
||||
{
|
||||
"id": "a6e40f1041b06c996f7b2406",
|
||||
"title": "Finders Keepers"
|
||||
},
|
||||
{
|
||||
"id": "a5deed1811a43193f9f1c841",
|
||||
"title": "Drop it"
|
||||
},
|
||||
{
|
||||
"id": "ab306dbdcc907c7ddfc30830",
|
||||
"title": "Steamroller"
|
||||
},
|
||||
{
|
||||
"id": "a8d97bd4c764e91f9d2bda01",
|
||||
"title": "Binary Agents"
|
||||
},
|
||||
{
|
||||
"id": "a10d2431ad0c6a099a4b8b52",
|
||||
"title": "Everything Be True"
|
||||
},
|
||||
{
|
||||
"id": "a97fd23d9b809dac9921074f",
|
||||
"title": "Arguments Optional"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfbeb5bd1f",
|
||||
"title": "Get Set for Ziplines"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c242eddfaeb5bd13",
|
||||
"title": "Build a Personal Portfolio Webpage"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd13",
|
||||
"title": "Build a Random Quote Machine"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd0f",
|
||||
"title": "Build a Pomodoro Clock"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd17",
|
||||
"title": "Build a JavaScript Calculator"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd18",
|
||||
"title": "Stylize Stories on Camper News"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd19",
|
||||
"title": "Build a Wikipedia Viewer"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eedfaeb5bd1c",
|
||||
"title": "Build a Tic Tac Toe Game"
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1c",
|
||||
"title": "Build a Simon Game"
|
||||
}
|
||||
],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Reclama tu certificado de desarrollo Front End",
|
||||
"descriptionEs": [
|
||||
[
|
||||
"http://i.imgur.com/syJxavV.jpg",
|
||||
"Una imagen que muestra nuestro certificado de desarrollo Front End",
|
||||
"Este desafío te otorga tu certificado autenticado de desarrollo Front End. Antes de que podamos emitir tu certificado, debemos verificar que has completado todos los Bonfires básicos e intermedios, y todos los Ziplines básicos e intermedios. También debes aceptar nuestro Juramento de honestidad académica. Pulsa el botón siguiente para iniciar este proceso.",
|
||||
""
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/HArFfMN.jpg",
|
||||
"Plagio (nombre): acción y efecto de plagiar. Plagiar (verbo) - copiar en lo sustancial obras ajenas, dándolas como propias.",
|
||||
"Al pulsar el botón siguiente, juras que todo el código en tus soluciones a los desafíos A) es código que tú o tu compañero escribieron personalmente, o B) proviene de librerías de código abierto como jQuery, o C) ha sido claramente atribuido a sus autores originales. También nos otorgas el permiso para auditar tus soluciones a los desafíos y revocar tu certificado si encontramos evidencia de plagio.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/14F2Van.jpg",
|
||||
"Una imagen del texto \"Front End Development Certificate requirements\"",
|
||||
"Confirmemos que has completado todos nuestros Bonfires básicos e intermedios, y todos nuestros Ziplines básicos e intermedios. Pulsa el botón siguiente para hacer la verificación.",
|
||||
"#"
|
||||
],
|
||||
[
|
||||
"http://i.imgur.com/16SIhHO.jpg",
|
||||
"Una imagen de la palabra \"Congratulations\"",
|
||||
"¡Felicitaciones! Hemos agregado tu Certificado de desarrollo Front End a tu portafolio. A menos que elijas no mostrar tus soluciones, este certificado será públicamente visible y verificable.",
|
||||
""
|
||||
]
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
4353
challenges/01-front-end-development-certification/html5-and-css.json
Normal file
4353
challenges/01-front-end-development-certification/html5-and-css.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,316 @@
|
||||
{
|
||||
"name": "Intermediate Front End Development Projects",
|
||||
"order": 11,
|
||||
"time": "200h",
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd10",
|
||||
"title": "Show the Local Weather",
|
||||
"challengeSeed": ["126415127"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/FreeCodeCamp/full/avqvgJ' target='_blank'>http://codepen.io/FreeCodeCamp/full/avqvgJ</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can see the weather in my current location.",
|
||||
"<span class='text-info'>User Story:</span> I can see a different icon or background image (e.g. snowy mountain, hot desert) depending on the weather.",
|
||||
"<span class='text-info'>User Story:</span> I can push a button to toggle between Fahrenheit and Celsius.",
|
||||
"We recommend using the <a href='http://openweathermap.org/current#geo' target='_blank'>Open Weather API</a>. This will require creating a free API key. Normally you want to avoid exposing API keys on CodePen, but we haven't been able to find a keyless API for weather.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Покажите местную погоду",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/AdventureBear/full/yNBJRj' target='_blank'>http://codepen.io/AdventureBear/full/yNBJRj</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу узнать погоду с учетом моего текущего местоположения.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные температурные значки.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу в зависимости от погоды видеть различные фоновые изображения (снежные горы, знойная пустыня).",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу нажать на кнопку чтобы переключится между градусами по Цельсию или по Фаренгейту.",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "Muestra el clima local",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/FreeCodeCamp/full/avqvgJ' target='_blank'>http://codepen.io/FreeCodeCamp/full/avqvgJ</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo obtener información acerca del clima en mi localización actual.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo ver un icono que depende del clima.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo ver una imagen de fondo diferente (ej. montaña nevada, desierto ardiente) dependiendo del clima.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo pulsar un botón para cambiar la unidad de temperatura de grados Fahrenheit a Celsius y viceversa.",
|
||||
"Recomendamos utilizar <a href='http://openweathermap.org/current#geo' target='_blank'>Open Weather API</a>. Al utilizarlo tendrás que crear una llave API gratuita. Normalmente debes evitar mostrar llaves de API en CodePen, pero por el momento no hemos encontrado un API de clima que no requiera llave.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1f",
|
||||
"title": "Use the Twitch.tv JSON API",
|
||||
"challengeSeed": ["126411564"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can see whether Free Code Camp is currently streaming on Twitch.tv.",
|
||||
"<span class='text-info'>User Story:</span> I can click the status output and be sent directly to the Free Code Camp's Twitch.tv channel.",
|
||||
"<span class='text-info'>User Story:</span> if Free Code Camp is streaming, I can see additional details about what they are streaming.",
|
||||
"<span class='text-info'>User Story:</span> I will see a placeholder notification if a streamer has closed their Twitch account. You can verify this works by adding brunofin and comster404 to your array of Twitch streamers.",
|
||||
"<span class='text-info'>Hint:</span> See an example call to Twitch.tv's JSONP API at <code>https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Zipline-Use-the-Twitchtv-JSON-API</code>.",
|
||||
"<span class='text-info'>Hint:</span> The relevant documentation about this API call is here: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Hint:</span> Here's an array of the Twitch.tv usernames of people who regularly stream coding: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "Используйте Twitch.tv JSON API",
|
||||
"descriptionRu": [
|
||||
"<span class='text-info'>Задание:</span> Создайте <a href='http://codepen.io' target='_blank'>CodePen.io</a> который успешно копирует вот этот: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||
"<span class='text-info'>Правило #1:</span> Не подсматривайте код приведенного на CodePen примера. Напишите его самостоятельно.",
|
||||
"<span class='text-info'>Правило #2:</span> Можете использовать любые библиотеки или API, которые потребуются.",
|
||||
"<span class='text-info'>Правило #3:</span> Воссоздайте функционал приведенного примера и не стесняйтесь добавить что-нибудь от себя.",
|
||||
"Реализуйте следующие <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>пользовательские истории</a>, сделайте также бонусные по желанию:",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу увидеть идет ли в данный момент на Twitch.tv трансляция Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу, кликнув на описание трансляции, перейти на канал Free Code Camp.",
|
||||
"<span class='text-info'>Пользовательская история:</span> В качестве пользователя, я могу видеть дополнительную информацию о текущей трансляции Free Code Camp.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу произвести поиск среди перечисленных каналов.",
|
||||
"<span class='text-info'>Бонусная пользовательская история:</span> В качестве пользователя, я могу видеть уведомление, если создатель канала закрыл свой аккаунт на Twitch.tv. Добавьте в массив имена пользователей brunofin и comster404, чтобы убедиться, что эта функция реализована правильно.",
|
||||
"<span class='text-info'>Подсказка:</span> Пример запроса к Twitch.tv JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
|
||||
"<span class='text-info'>Подсказка:</span> Документацию об этом запросе можно найти по ссылке: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Подсказка:</span> В этом массиве приведены имена пользователей, которые регулярно пишут код онлайн: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"comster404\",\"brunofin\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"Если что-то не получается, воспользуйтесь <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a>.",
|
||||
"Когда выполните задание кликните кнопку \"I've completed this challenge\" и добавьте ссылку на ваш CodePen. Если вы программировали с кем-то в паре, также добавьте имя вашего напарника.",
|
||||
"Если вы хотите получить немедленную оценку вашего проекта, нажмите эту кнопку и добавьте ссылку на ваш CodePen. В противном случае мы проверим его перед тем как вы приступите к проектам для некоммерческих организаций.<br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Click here then add your link to your tweet's text</a>"
|
||||
],
|
||||
"nameEs": "Usa el API JSON de Twitch.tv",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/GeoffStorbeck/full/GJKRxZ' target='_blank'>http://codepen.io/GeoffStorbeck/full/GJKRxZ</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo verificar si Free Code Camp está transmitiendo en Twitch.tv",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo pulsar el estatus y ser enviado directamente al canal de Free Code Camp's en Twitch.tv.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, si Free Code Camp está transmitiendo, puedo ver detalles adicionales acerca del contenido que están pasando.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo buscar entre los canales listados.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo ver una notificación si el usuario ha cerrado su cuenta de Twitch. Puedes verificar si esto funciona agregando brunofin y comster404 a tu vector de usuarios de Twitch.",
|
||||
"<span class='text-info'>Pista:</span> Puedes ver un ejemplo de una llamada al API JSONP de Twitch.tv en <code>https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Zipline-Use-the-Twitchtv-JSON-API</code>.",
|
||||
"<span class='text-info'>Pista:</span> La documentación relevante para esta llamada al API se encuentra aquí: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
|
||||
"<span class='text-info'>Pista:</span> Aquí te mostramos un vector de usuarios de Twitch.tv de gente que transmite programación a menudo: <code>[\"freecodecamp\", \"storbeck\", \"terakilobyte\", \"habathcx\",\"RobotCaleb\",\"thomasballinger\",\"noobs2ninjas\",\"beohoff\"]</code>",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
|
||||
"id": "bd7158d8c442eddfaeb5bd18",
|
||||
"title": "Stylize Stories on Camper News",
|
||||
"challengeSeed": ["126415129"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/MarufSarker/full/ZGPZLq/' target='_blank'>http://codepen.io/MarufSarker/full/ZGPZLq/</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can browse recent posts from Camper News.",
|
||||
"<span class='text-info'>User Story:</span> I can click on a post to be taken to the story's original URL.",
|
||||
"<span class='text-info'>User Story:</span> I can see how many upvotes each story has.",
|
||||
"<span class='text-info'>Hint:</span> Here's the Camper News Hot Stories API endpoint: <code>http://www.freecodecamp.com/news/hot</code>.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Adorna las noticias de Camper News",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/MarufSarker/full/ZGPZLq/' target='_blank'>http://codepen.io/MarufSarker/full/ZGPZLq/</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo navegar las publicaciones recientes de Camper News.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo pulsar en una publicación y ser llevado al URL original de la historia.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo ver cuántos votos tiene cada historia.",
|
||||
"<span class='text-info'>Pista:</span> Este es el endpoint del API de Noticias calientes de Camper News: <code>http://www.freecodecamp.com/news/hot</code>.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd19",
|
||||
"title": "Build a Wikipedia Viewer",
|
||||
"challengeSeed": ["126415131"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/GeoffStorbeck/full/MwgQea' target='_blank'>http://codepen.io/GeoffStorbeck/full/MwgQea</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can search Wikipedia entries in a search box and see the resulting Wikipedia entries.",
|
||||
"<span class='text-info'>User Story:</span> I can click a button to see a random Wikipedia entry.",
|
||||
"<span class='text-info'>User Story:</span> When I type in the search box, I can see a dropdown menu with autocomplete options for matching Wikipedia entries.",
|
||||
"<span class='text-info'>Hint:</span> Here's an entry on using Wikipedia's API: <code>http://www.mediawiki.org/wiki/API:Main_page</code>.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Crea un buscador de Wikipedia",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/GeoffStorbeck/full/MwgQea' target='_blank'>http://codepen.io/GeoffStorbeck/full/MwgQea</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo hacer una búsqueda a la base de datos de Wikipedia en una caja de búsqueda y ver los artículos resultantes.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span>Como usuario, puedo pulsar un botón para ver un artículo aleatorio de Wikipedia.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span>Como usuario, cuando escribo en la caja de búsqueda, puedo ver un menú desplegable con opciones de autocompletar referentes a artículos similares de Wikipedia.",
|
||||
"<span class='text-info'>Pista:</span> Esta es un artículo muy útil relativo al uso del API de Wikipedia: <code>http://www.mediawiki.org/wiki/API:Main_page</code>.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eedfaeb5bd1c",
|
||||
"title": "Build a Tic Tac Toe Game",
|
||||
"challengeSeed": ["126415123"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/alex-dixon/full/JogOpQ/' target='_blank'>http://codepen.io/alex-dixon/full/JogOpQ/</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I can play a game of Tic Tac Toe with the computer.",
|
||||
"<span class='text-info'>User Story:</span> I can never actually win against the computer - at best I can tie.",
|
||||
"<span class='text-info'>User Story:</span> My game will reset as soon as it's over so I can play again.",
|
||||
"<span class='text-info'>User Story:</span> I can choose whether I want to play as X or O.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Crea un juego de Tic Tac Toe",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/alex-dixon/full/JogOpQ/' target='_blank'>http://codepen.io/alex-dixon/full/JogOpQ/</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo iniciar un juego de Tic Tac Toe con la computadora.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, nunca puedo ganar contra la computadora - en el mejor de los casos puedo empatar.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, mi juego se reiniciará tan pronto como se termine, de tal forma que pueda jugar de nuevo.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo elegir si quiero jugar como X o como O.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
},
|
||||
{
|
||||
"id": "bd7158d8c442eddfaeb5bd1c",
|
||||
"title": "Build a Simon Game",
|
||||
"challengeSeed": ["137213633"],
|
||||
"description": [
|
||||
"<span class='text-info'>Objective:</span> Build a <a href='http://codepen.io' target='_blank'>CodePen.io</a> app that is functionally similar to this: <a href='http://codepen.io/Em-Ant/full/QbRyqq/' target='_blank'>http://codepen.io/dting/full/QbRyqq/</a>.",
|
||||
"<span class='text-info'>Rule #1:</span> Don't look at the example project's code on CodePen. Figure it out for yourself.",
|
||||
"<span class='text-info'>Rule #2:</span> Fulfill the below <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>user stories</a>. Use whichever libraries or APIs you need. Give it your own personal style.",
|
||||
"<span class='text-info'>User Story:</span> I am presented with a random series of button presses.",
|
||||
"<span class='text-info'>User Story:</span> each time I input a series of button presses correctly, I see the same series of button presses but with an additional step.",
|
||||
"<span class='text-info'>User Story:</span> I hear a sound that corresponds to each button both when the series of button presses plays, and when I personally press a button.",
|
||||
"<span class='text-info'>User Story:</span> If I press the wrong button, I am notified that I have done so, and that series of button presses starts again to remind me of the pattern so I can try again.",
|
||||
"<span class='text-info'>User Story:</span> I can see how many steps are in the current series of button presses.",
|
||||
"<span class='text-info'>User Story:</span> If I want to restart, I can hit a button to do so, and the game will return to a single step.",
|
||||
"<span class='text-info'>User Story:</span> I can play in strict mode where if I get a button press wrong, it notifies me that I have done so, and the game restarts at a new random series of button presses.",
|
||||
"<span class='text-info'>User Story:</span> The tempo of the game speeds up incrementally on the 5th, 9th and 13th step.",
|
||||
"<span class='text-info'>User Story:</span> I can win the game by getting a series of 20 steps correct. I am notified of my victory, then the game starts over.",
|
||||
"<span class='text-info'>Hint:</span> Here are mp3s you can use for each button: <code>https://s3.amazonaws.com/freecodecamp/simonSound1.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound2.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound3.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound4.mp3</code>.",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"tests": [],
|
||||
"nameCn": "",
|
||||
"descriptionCn": [],
|
||||
"nameFr": "",
|
||||
"descriptionFr": [],
|
||||
"nameRu": "",
|
||||
"descriptionRu": [],
|
||||
"nameEs": "Construye un juego de Simon",
|
||||
"descriptionEs": [
|
||||
"<span class='text-info'>Objetivo:</span> Crea una aplicación con <a href='http://codepen.io' target='_blank'>CodePen.io</a> que reproduzca efectivamente mediante ingeniería inversa este app: <a href='http://codepen.io/Em-Ant/full/QbRyqq/' target='_blank'>http://codepen.io/dting/full/QbRyqq/</a>.",
|
||||
"<span class='text-info'>Regla #1:</span> No veas el código del proyecto de ejemplo en CodePen. Encuentra la forma de hacerlo por tu cuenta.",
|
||||
"<span class='text-info'>Regla #2:</span> Puedes usar cualquier librería o APIs que necesites.",
|
||||
"<span class='text-info'>Regla #3:</span> Usa ingeniería inversa para reproducir la funcionalidad del proyecto de ejemplo, pero también siéntete en la libertad de personalizarlo.",
|
||||
"Las siguientes son las <a href='http://en.wikipedia.org/wiki/User_story' target='_blank'>historias de usuario</a> que debes satisfacer, incluyendo las historias opcionales:",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, se me presenta una serie de colores aleatoria.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, cada vez que presiono una secuencia de colores correctamente, veo la misma serie de colores con un paso adicional.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, escucho un sonido que corresponde a cada botón cuando una sequencia se me presenta, así como cuando yo presiono un botón.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, si presiono el botón equivocado, se me notifica sobre mi error, y la serie correcta de colores se muestra de nuevo para recordarme cuál es la secuencia correcta, tras lo cual puedo probar de nuevo.",
|
||||
"<span class='text-info'>Historia de usuario:</span> Como usuario, puedo ver cuántos pasos hay en la serie de botones actual.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, si deseo reiniciar, puedo pulsar un botón para hacerlo, y el juego comenzará desde una secuencia con un solo paso.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo jugar en modo estricto donde si presiono el botón equivocado, se me notifica de mi error, y el juego vuelve a comenzar con una nueva serie aleatoria de colores.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, la velocidad del juego se incrementa en el quinto, noveno y decimotercer paso.",
|
||||
"<span class='text-info'>Historia de usuario opcional:</span> Como usuario, puedo ganar el juego si completo 20 pasos correctos. Se me notifica sobre mi victoria, tras lo cual el juego se reinicia.",
|
||||
"<span class='text-info'>Pista:</span> Aquí hay algunos mp3s que puedes utilizar para tus botones: <code>https://s3.amazonaws.com/freecodecamp/simonSound1.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound2.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound3.mp3</code>, <code>https://s3.amazonaws.com/freecodecamp/simonSound4.mp3</code>.",
|
||||
"Recuerda utilizar <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> si te sientes atascado.",
|
||||
"Cuando hayas terminado, pulsa el botón de \"I've completed this challenge\" e incluye un link a tu CodePen. Si programaste en pareja, debes incluir también el nombre de usuario de Free Code Camp de tu compañero.",
|
||||
"Si quieres retroalimentación inmediata de parte de tus compañeros campistas, pulsa este botón y pega el link de tu proyecto en CodePen. <br><br><a class='btn btn-primary btn-block' href='https://twitter.com/intent/tweet?text=Check%20out%20the%20project%20I%20just%20built%20with%20%40FreeCodeCamp:%20PASTE_YOUR_CODEPEN_URL_HERE%20%0A%20%23LearnToCode%20%23JavaScript' target='_blank'>Pulsa aquí y agrega tu link en el texto del tweet</a>"
|
||||
],
|
||||
"namePt": "",
|
||||
"descriptionPt": []
|
||||
}
|
||||
]
|
||||
}
|
1098
challenges/01-front-end-development-certification/jquery.json
Normal file
1098
challenges/01-front-end-development-certification/jquery.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,464 @@
|
||||
{
|
||||
"name": "JSON APIs and Ajax",
|
||||
"order": 10.5,
|
||||
"time": "2h",
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bb000000000000000000001",
|
||||
"title": "Trigger Click Events with jQuery",
|
||||
"description": [
|
||||
"In this section, we'll learn how to get data from APIs. APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another.",
|
||||
"We'll also learn how to update HTML with the data we get from these APIs using a technology called Ajax.",
|
||||
"First, let's review what the <code>$(document).ready()</code> function does. This function makes it so all code inside of it only runs once our page loads.",
|
||||
"Let's make our \"Get Message\" button change the text of the element with the class <code>message</code>.",
|
||||
"Before we can do this, we need to implement a <code>click event</code> inside of our <code>$(document).ready()</code> function by adding this code:",
|
||||
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
||||
"",
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(?:'|\")\\#getMessage(?:'|\")\\s*?\\)\\s*?\\.on\\s*?\\(\\s*?(?:'|\")click(?:'|\")\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'message: Bind the click event to the button with the ID of <code>getMessage</code>');",
|
||||
"assert(code.match(/\\n*?\\s*?\\}\\n*?\\s*?\\);/gi) && code.match(/\\n*?\\s*?\\}\\);/gi).length >= 2, 'message: Be sure to close your functions with <code>});</code>');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Activa eventos de pulsación con jQuery",
|
||||
"descriptionEs": [
|
||||
"En esta sección, vamos a aprender cómo obtener datos de las APIs. Las APIs - o interfaces de programación de aplicaciones - son herramientas que utilizan los computadores para comunicarse entre sí.",
|
||||
"También aprenderemos cómo actualizar HTML con los datos que obtenemos de estas API usando una tecnología llamada Ajax.",
|
||||
"En primer lugar, vamos a revisar lo que hace la función <code>$(document).ready()</code>. Esta función hace que todo el código dentro de ella se ejecute sólo hasta que nuestra página ha sido cargada.",
|
||||
"Hagamos que nuestro botón \"Get message\" cambie el texto del elemento con clase <code>message</code>.",
|
||||
"Antes de poder hacer esto, tenemos que implementar un <code>evento de pulsación</code> dentro de nuestra función <code>$(document).ready()</code>, añadiendo este código:",
|
||||
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
||||
"",
|
||||
"<code>});</code>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bc000000000000000000001",
|
||||
"title": "Change Text with Click Events",
|
||||
"description": [
|
||||
"When our click event happens, we can use Ajax to update an HTML element.",
|
||||
"Let's make it so that when a user clicks the \"Get Message\" button, we change the text of the element with the class <code>message</code> to say \"Here is the message\".",
|
||||
"We can do this by adding the following code within our click event:",
|
||||
"<code> $(\".message\").html(\"Here is the message\");</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(?:'|\")\\.message(?:'|\")\\s*?\\)\\s*?\\.html\\s*?\\(\\s*?(?:'|\")Here\\sis\\sthe\\smessage(?:'|\")\\s*?\\);/gi), 'message: Clicking the \"Get Message\" button should give the element with the class <code>message</code> the text \"Here is the message\".');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"#getMessage\").on(\"click\", function(){",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Cambia texto con eventos de pulsación",
|
||||
"descriptionEs": [
|
||||
"Cuando nuestro evento de pulsación ocurre, podemos utilizar Ajax para actualizar un elemento HTML.",
|
||||
"Hagamos que cuando un usuario pulse el botón \"Get Message\", el texto del elemento con la clase <code>message</code> cambie para decir \"Here is the message\".",
|
||||
"Podemos hacerlo añadiendo el siguiente código dentro de nuestro evento de pulsación:",
|
||||
"<code> $(\".message\").html(\"Here is the message\");</code>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000002",
|
||||
"title": "Get JSON with the jQuery getJSON Method",
|
||||
"description": [
|
||||
"You can also request data from an external source. This is where APIs come into play.",
|
||||
"Remember that APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another.",
|
||||
"Most web APIs transfer data in a format called JSON. JSON stands for JavaScript Object Notation.",
|
||||
"You've already been using JSON whenever you create a JavaScript object. JSON is nothing more than object properties and their current values, sandwiched between a <code>{</code> and a <code>}</code>.",
|
||||
"These properties and their values are often referred to as \"key-value pairs\".",
|
||||
"Let's get the JSON from Free Code Camp's Cat Photo API.",
|
||||
"Here's the code you can put in your click event to do this:",
|
||||
"<code> $.getJSON(\"/json/cats.json\", function(json) {</code>",
|
||||
"<code> $(\".message\").html(JSON.stringify(json));</code>",
|
||||
"<code> });</code>",
|
||||
"Once you've added this, click the \"Get Message\" button. Your Ajax function will replace the \"The message will go here\" text with the raw JSON output from the Free Code Camp Cat Photo API."
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\#getMessage(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?on\\s*?\\(\\s*?(\\\"|\\')click(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'message: You should have a click handler on the getMessage button to trigger the AJAX request.');",
|
||||
"assert(code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi), 'message: You should have at least one closing set of brackets and parenthesis.');",
|
||||
"assert(code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi) && code.match(/\\,\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi) && code.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi).length === code.match(/\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi).length, 'message: Each callback function should have a closing set of brackets and parenthesis.');",
|
||||
"assert(code.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?(\\\"|\\')\\\/json\\\/cats\\.json(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'message: You should be making use of the getJSON method given in the description to load data from the json file.');",
|
||||
"assert(code.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\.message(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?html\\s*?\\(\\s*?JSON\\s*?\\.\\s*?stringify\\s*?\\(\\s*?json\\s*?\\)\\s*?\\)/gi), 'message: Don\\'t forget to make the <code>.html</code> change the contents of the message box so that it contains the result of the getJSON.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#getMessage\").on(\"click\", function(){",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Obtén JSON con el método getJSON de jQuery",
|
||||
"descriptionEs": [
|
||||
"También puedes solicitar los datos de una fuente externa. Aquí es donde entran en juego las API. ",
|
||||
"Recuerda que las API - o interfaces de programación de aplicaciones - son herramientas que utilizan los ordenadores para comunicarse entre sí.",
|
||||
"La mayoría de las API para el web transfieren datos en un formato llamado JSON. JSON significa notación de objeto JavaScript (<em>JavaScript Object Notation</em>).",
|
||||
"Tú ya has usado JSON al crear objetos en JavaScript. JSON no es más que las propiedades del objeto y sus valores actuales, intercalados entre un <code>{</code> y un <code>}</code>. ",
|
||||
"Estas propiedades y sus valores a menudo se denominan \" pares llave-valor\".",
|
||||
"Vamos a obtener el JSON de la API de fotos de gato de Free Code Camp.",
|
||||
"Aquí está el código que puedes poner en tu evento de pulsación para lograrlo:",
|
||||
"<code> $.getJSON(\"/json/cats.json\", function(json) {</code>",
|
||||
"<code> $(\".message\").html(JSON.stringify(json));</code>",
|
||||
"<code> });</code>",
|
||||
"Una vez lo añadas, pulsa el botón \"Get Message\". Su función Ajax sustituirá el texto \"The message will go here\" con la salida JSON en bruto de la API de fotos de gato de Free Code Camp."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000003",
|
||||
"title": "Convert JSON Data to HTML",
|
||||
"description": [
|
||||
"Now that we're getting data from a JSON API, let's display it in our HTML.",
|
||||
"We can use the <code>.forEach()</code> method to loop through our data and modify our HTML elements.",
|
||||
"First, let's declare an html variable with <code>var html = \"\";</code>.",
|
||||
"Then, let's loop through our JSON, adding more HTML to that variable. When the loop is finished, we'll render it.",
|
||||
"Here's the code that does this:",
|
||||
"<code>json.forEach(function(val) {</code>",
|
||||
"<code> var keys = Object.keys(val);</code>",
|
||||
"<code> html += \"<div class = 'cat'>\";</code>",
|
||||
"<code> keys.forEach(function(key) {</code>",
|
||||
"<code> html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";</code>",
|
||||
"<code> });</code>",
|
||||
"<code> html += \"</div><br>\";</code>",
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/json\\.forEach/gi), 'message: The message box should have something in it.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#getMessage\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function(json) {",
|
||||
"",
|
||||
" var html = \"\";",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
"",
|
||||
" $(\".message\").html(html);",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Convierte datos JSON a datos HTML",
|
||||
"descriptionEs": [
|
||||
"Ahora que estamos obteniendo datos de una API JSON, mostremóslos en nuestro HTML.",
|
||||
"Podemos usar el método <code>.forEach()</code> para recorrer nuestros datos y modificar nuestros elementos HTML.",
|
||||
"En primer lugar, vamos a declarar una variable llamada <code>html</code> con <code>var html = \"\";</code>.",
|
||||
"Después, iteremos a traveś de nuestro JSON, añadiendo más HTML a esa variable. Cuando se termina el ciclo, vamos a presentarla. ",
|
||||
"Aquí está el código que hace esto:",
|
||||
"<code>json.forEach(function(val) {</code>",
|
||||
"<code> var keys = Object.keys(val);</code>",
|
||||
"<code> html += \"<div class = 'cat'>\";</code>",
|
||||
"<code> keys.forEach(function(key) {</code>",
|
||||
"<code> html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";</code>",
|
||||
"<code> });</code>",
|
||||
"<code> html += \"</div><br>\";</code>",
|
||||
"<code>});</code>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000004",
|
||||
"title": "Render Images from Data Sources",
|
||||
"description": [
|
||||
"We've seen from the last two lessons that each object in our JSON array contains an <code>imageLink</code> key with a value that is the url of a cat's image.",
|
||||
"When we're looping through these objects, let's use this <code>imageLink</code> property to display this image in an <code>img</code> element.",
|
||||
"Here's the code that does this:",
|
||||
"<code> html += \"<img src = '\" + val.imageLink + \"'>\";</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/val.imageLink/gi), 'message: You should have used the <code>imageLink</code> property to display the images.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#getMessage\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function(json) {",
|
||||
"",
|
||||
" var html = \"\";",
|
||||
"",
|
||||
" json.forEach(function(val) {",
|
||||
"",
|
||||
" html += \"<div class = 'cat'>\";",
|
||||
"",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
"",
|
||||
" html += \"</div>\";",
|
||||
"",
|
||||
" });",
|
||||
"",
|
||||
" $(\".message\").html(html);",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Presenta imágenes de fuentes de datos",
|
||||
"descriptionEs": [
|
||||
"Tanto en el JSON que recibimos de la API de fotos de gato de Free Code Camp, como en ",
|
||||
"lo que hemos visto en las dos últimas lecciones, cada objeto en nuestro vector JSON contiene una llave <code>imageLink</code> con un valor que corresponde a la url de la imagen de un gato.",
|
||||
"Cuando estamos recorriendo estos objetos, usemos esta propiedad <code>imageLink</code> para visualizar la imagen en un elemento <code>img</code>.",
|
||||
"Aquí está el código que hace esto:",
|
||||
"<code> html += \"<img src = '\" + val.imageLink + \"'>\";</code>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000005",
|
||||
"title": "Prefilter JSON",
|
||||
"description": [
|
||||
"If we don't want to render every cat photo we get from our Free Code Camp's Cat Photo JSON API, we can pre-filter the json before we loop through it.",
|
||||
"Let's filter out the cat whose \"id\" key has a value of 1.",
|
||||
"Here's the code to do this:",
|
||||
"<code>json = json.filter(function(val) {</code>",
|
||||
"<code> return(val.id !== 1);</code>",
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/filter/gi), 'message: You should be making use of the .filter method.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#getMessage\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function(json) {",
|
||||
"",
|
||||
" var html = \"\";",
|
||||
"",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
"",
|
||||
" json.forEach(function(val) {",
|
||||
"",
|
||||
" html += \"<div class = 'cat'>\"",
|
||||
"",
|
||||
" html += \"<img src = '\" + val.imageLink + \"'>\"",
|
||||
"",
|
||||
" html += \"</div>\"",
|
||||
"",
|
||||
" });",
|
||||
"",
|
||||
" $(\".message\").html(html);",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Pre-filtra JSON",
|
||||
"descriptionEs": [
|
||||
"Si no queremos presentar cada foto de gato que obtengamos de la API JSON de fotos de gato de Free Code Camp, podemos pre-filtrar el json antes de iterar a través de este.",
|
||||
"Vamos a filtrar el gato cuya llave \"id\" tiene un valor de 1.",
|
||||
"Aquí está el código para hacer esto:",
|
||||
"<code>json = json.filter(function(val) {</code>",
|
||||
"<code> return(val.id !== 1);</code>",
|
||||
"<code>});</code>"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000006",
|
||||
"title": "Get Geo-location Data",
|
||||
"description": [
|
||||
"Another cool thing we can do is access our user's current location. Every browser has a built in navigator that can give us this information.",
|
||||
"The navigator will get our user's current longitude and latitude.",
|
||||
"You will see a prompt to allow or block this site from knowing your current location. The challenge can be completed either way, as long as the code is correct.",
|
||||
"By selecting allow you will see the text on the output phone change to your latitude and longitude",
|
||||
"Here's some code that does this:",
|
||||
"<code>if (navigator.geolocation) {</code>",
|
||||
"<code> navigator.geolocation.getCurrentPosition(function(position) {</code>",
|
||||
"<code> $(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);</code>",
|
||||
"<code> });</code>",
|
||||
"<code>}</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(code.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'message: You should make use of the <code>navigator.geolocation</code> to access the users current location.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" // Only change code below this line.",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" // Only change code above this line.",
|
||||
"fcces",
|
||||
"<div id = \"data\">",
|
||||
" <h4>You are here:</h4>",
|
||||
" ",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Recibir datos de Geo-localización",
|
||||
"descriptionEs": [
|
||||
"Otra cosa interesante que podemos hacer es acceder a la ubicación actual de nuestros usuarios. Todos los navegadores han incorporado un geo-localizador que nos puede dar esta información. ",
|
||||
"El navegador puede obtener la longitud y latitud actual de nuestros usuarios.",
|
||||
"Como usuario verás un mensaje para permitir o evitar que el sitio conozca tu ubicación actual. El desafío se puede completar de cualquier manera, siempre y cuando el código sea correcto. ",
|
||||
"Si lo permites, verás que el texto en el teléfono de la derecha cambiará con tu latitud y longitud",
|
||||
"Aquí hay un código que hace esto:",
|
||||
"<code>if (navigator.geolocation) {</code>",
|
||||
"<code> navigator.geolocation.getCurrentPosition(function(position) {</code>",
|
||||
"<code> $(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);</code>",
|
||||
"<code> });</code>",
|
||||
"<code>}</code>"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,648 @@
|
||||
{
|
||||
"name": "Object Oriented and Functional Programming",
|
||||
"order": 7,
|
||||
"time": "2h",
|
||||
"note": [
|
||||
"Methods",
|
||||
"Closures",
|
||||
"Factories",
|
||||
"Pure Functions",
|
||||
"Currying Functions",
|
||||
"Functors",
|
||||
"Currying Functions"
|
||||
],
|
||||
"challenges": [
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb1bdef",
|
||||
"title": "Declare JavaScript Objects as Variables",
|
||||
"description": [
|
||||
"Before we dive into Object Oriented Programming, let's revisit JavaScript objects.",
|
||||
"Give your <code>motorBike</code> object a <code>wheels</code>, <code>engines</code> and <code>seats</code> attribute and set them to numbers."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof motorBike.engines === 'number', 'message: <code>motorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof motorBike.wheels === 'number', 'message: <code>motorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof motorBike.seats === 'number', 'message: <code>motorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var car = {",
|
||||
" \"wheels\":4,",
|
||||
" \"engines\":1,",
|
||||
" \"seats\":5",
|
||||
"};",
|
||||
"",
|
||||
"var motorBike = {",
|
||||
"",
|
||||
" // Only change code below this line.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
" // Only change code above this line.",
|
||||
"",
|
||||
"};"
|
||||
],
|
||||
"tail": [
|
||||
"(function() {return JSON.stringify(motorBike);})();"
|
||||
],
|
||||
"solutions": [
|
||||
"var car = {\n \"wheels\":4,\n \"engines\":1,\n \"seats\":5\n};\n\nvar motorBike = {\n \"wheels\": 4,\n \"engines\": 1,\n \"seats\": 2\n};"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Declara objetos de JavaScript como variables",
|
||||
"descriptionEs": [
|
||||
"Antes de sumergirnos en Programación Orientada a Objetos, vamos a revisar los objetos de JavaScript.",
|
||||
"Dale a tu objeto <code>motorBike</code> un atributo <code>wheels</code>, otro llamado <code>motors</code> y otro <code>seats</code> y asignales números."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb2bdef",
|
||||
"title": "Construct JavaScript Objects with Functions",
|
||||
"description": [
|
||||
"We are also able to create objects using <code>constructor</code> functions.",
|
||||
"A <code>constructor</code> function is given a capitalized name to make it clear that it is a <code>constructor</code>.",
|
||||
"Here's an example of a <code>constructor</code> function:",
|
||||
"<code>var Car = function() {</code>",
|
||||
"<code> this.wheels = 4;</code>",
|
||||
"<code> this.engines = 1;</code>",
|
||||
"<code> this.seats = 1;</code>",
|
||||
"<code>};</code>",
|
||||
"In a <code>constructor</code> the <code>this</code> variable refers to the new object being created by the constructor. So when we write,",
|
||||
"<code> this.wheels = 4;</code>",
|
||||
"inside of the <code>constructor</code> we are giving the new object it creates a property called <code>wheels</code> with a value of <code>4</code>.",
|
||||
"You can think of a <code>constructor</code> as a description for the object it will create.",
|
||||
"Have your <code>MotorBike</code> <code>constructor</code> describe an object with <code>wheels</code>, <code>engines</code> and <code>seats</code> properties and set them to numbers."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof (new MotorBike()).engines === 'number', 'message: <code>MotorBike</code> should have a <code>engines</code> attribute set to a number.');",
|
||||
"assert(typeof (new MotorBike()).wheels === 'number', 'message: <code>MotorBike</code> should have a <code>wheels</code> attribute set to a number.');",
|
||||
"assert(typeof (new MotorBike()).seats === 'number', 'message: <code>MotorBike</code> should have a <code>seats</code> attribute set to a number.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var Car = function() {",
|
||||
" this.wheels = 4;",
|
||||
" this.engines = 1;",
|
||||
" this.seats = 1;",
|
||||
"};",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var MotorBike = function() {",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"};"
|
||||
],
|
||||
"tail": [
|
||||
"(function() {return JSON.stringify(new MotorBike());})();"
|
||||
],
|
||||
"solutions": [
|
||||
"var Car = function() {\n this.wheels = 4;\n this.engines = 1;\n this.seats = 1;\n};\n\nvar myCar = new Car();\n\nvar MotorBike = function() {\n this.engines = 1;\n this.seats = 1;\n this.wheels = 4;\n};\n\nvar myMotorBike = new MotorBike();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Construye objetos de JavaScript con funciones",
|
||||
"descriptionEs": [
|
||||
"También podemos crear objetos utilizando funciones <code>constructoras</code>.",
|
||||
"A cada función <code>constructora</code> se le da un nombre comenzando en mayúsculas para que quede claro que es una <code>constructora</code>.",
|
||||
"He aquí un ejemplo de una función <code>constructora</code>:",
|
||||
"<code>var Carro = function() {</code>",
|
||||
"<code>& nbsp; & nbsp; this.llantas = 4; </code>",
|
||||
"<code>& nbsp; & nbsp; this.motores = 1; </code>",
|
||||
"<code>& nbsp; & nbsp; this.asientos = 1; </code>",
|
||||
"<code>}; </code>",
|
||||
"En una <code>constructora</code> la variable <code>this</code> hace referencia al nuevo objeto que está siendo creado por la constructora. Así que cuando escribimos ",
|
||||
"<code> this.llantas = 4;</code>",
|
||||
"dentro de la <code>constructora</code> le estamos dando el nuevo objeto que se crea una propiedad llamada <code>llantas</code> con un valor de <code>4</code>.",
|
||||
"Puedes pensar en una <code>constructora</code> como una descripción del objeto que crea.",
|
||||
"Haz que tu <code>constructora</code> <code>MotorBike</code> describa un objeto con las propiedades <code>wheels</code>,<code>engines</code> and <code>seats</code> y asignales números."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb4bdef",
|
||||
"title": "Make Instances of Objects with a Constructor Function",
|
||||
"description": [
|
||||
"Now let's put that great <code>constructor</code> function we made in the last lesson to use!",
|
||||
"To use a <code>constructor</code> function we call it with the <code>new</code> keyword in front of it like:",
|
||||
"<code>var myCar = new Car();</code>",
|
||||
"<code>myCar</code> is now an <code>instance</code> of the <code>Car</code> constructor that looks like the object it described:",
|
||||
"<code>{</code>",
|
||||
"<code> wheels: 4,</code>",
|
||||
"<code> engines: 1,</code>",
|
||||
"<code> seats: 1</code>",
|
||||
"<code>}</code>",
|
||||
"Note that it is important to use the <code>new</code> keyword when calling a constructor. This is how Javascript knows to create a new object and that all the references to <code>this</code> inside the constructor should be referring to this new object.",
|
||||
"Now, once the <code>myCar</code> <code>instance</code> is created it can be used like any other object and can have its properties accessed and modified the same way you would usually. For example:",
|
||||
"<code>myCar.turboType = \"twin\";</code>",
|
||||
"Our <code>myCar</code> variable now has a property <code>turboType</code> with a value of <code>\"twin\"</code>.",
|
||||
"In the editor, use the <code>Car</code> <code>constructor</code> to create a new <code>instance</code> and assign it to <code>myCar</code>.",
|
||||
"Then give <code>myCar</code> a <code>nickname</code> property with a string value."
|
||||
],
|
||||
"tests": [
|
||||
"assert((new Car()).wheels === 4, 'message: The property <code>wheels</code> should still be <code>4</code> in the object <code>constructor</code>.');",
|
||||
"assert(typeof (new Car()).nickname === 'undefined', 'message: There should not be a property <code>nickname</code> in the object <code>constructor</code>.');",
|
||||
"assert(myCar.wheels === 4, 'message: The property <code>wheels</code> of <code>myCar</code> should equal <code>4</code>.');",
|
||||
"assert(typeof myCar.nickname === 'string', 'message: The property <code>nickname</code> of <code>myCar</code> should be a string.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var Car = function() {",
|
||||
" this.wheels = 4;",
|
||||
" this.engines = 1;",
|
||||
" this.seats = 1;",
|
||||
"};",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var myCar;"
|
||||
],
|
||||
"tail": [
|
||||
"(function() {return JSON.stringify(myCar);})();"
|
||||
],
|
||||
"solutions": [
|
||||
"var Car = function() {\n this.wheels = 4;\n this.engines = 1;\n this.seats = 1;\n};\n\nvar myCar = new Car();\n\nmyCar.nickname = \"Lucy\";"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Crea instancias de objetos con funciones constructoras",
|
||||
"descriptionEs": [
|
||||
"¡Ahora usemos esa gran <code>constructora</code> que hicimos en la última lección!",
|
||||
"Para utilizar una función <code>constructora</code> la llamamos con la palabra reservada <code>new</code> al frente, como:",
|
||||
"<code>var miCarro = new Carro();</code>",
|
||||
"<code>miCarro</code>es ahora una <code>instancia</code> de la constructora <code>Carro</code> que se parece al objeto que describe:",
|
||||
"<code>{</code>",
|
||||
"<code> wheels: 4,</code>",
|
||||
"<code> engines: 1,</code>",
|
||||
"<code> seats: 1</code>",
|
||||
"<code>}</code>",
|
||||
"Tenga en cuenta que es importante utilizar la palabra reservaa <code>new</code> cuando se llama a una constructora. Así es como Javascript sabe crear un objeto nuevo y hace que todas las referencias a <code>this</code> dentro del constructor se refieran al objeto nuevo ",
|
||||
"Ahora, una vez que la <code>instancia</code> <code>miCarro</code> se crea, puede ser utilizada como cualquier otro objeto y puedes acceder o modificar sus propiedades como lo harías normalmente. Por ejemplo:",
|
||||
"<code>miCarro.tipoTurbo = \"doble\"; </code>",
|
||||
"Nuestra variable <code>miCarro</code> tiene ahora una propiedad <code>tipoTurbo</code> con un valor de <code>\"doble\"</code>.",
|
||||
"En el editor, utiliza la <code>constructora</code> <code>Car</code> para crear una nueva <code>instancia</code> y asignala a <code>myCar</code>.",
|
||||
"A continuación, dale a <code>myCar</code> una propiedad <code>nickname</code> con un valor tipo cadena."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "563cfb55594311ffcb333c70",
|
||||
"title": "Make Unique Objects by Passing Parameters to our Constructor",
|
||||
"description": [
|
||||
"The <code>constructor</code> we have is great, but what if we don't always want to create the same object?",
|
||||
"To solve this we can add <code>parameters</code> to our <code>constructor</code>. We do this like the following example:",
|
||||
"<code>var Car = function(wheels, seats, engines) {</code>",
|
||||
"<code> this.wheels = wheels;</code>",
|
||||
"<code> this.seats = seats;</code>",
|
||||
"<code> this.engines = engines;</code>",
|
||||
"<code>};</code>",
|
||||
"Now we can pass in <code>arguments</code> when we call our <code>constructor</code>.",
|
||||
"<code>var myCar = new Car(6, 3, 1);</code>",
|
||||
"This code will create an object that uses the <code>arguments</code> we passed in and looks like:",
|
||||
"<code>{</code>",
|
||||
"<code> wheels: 6,</code>",
|
||||
"<code> seats: 3,</code>",
|
||||
"<code> engines: 1</code>",
|
||||
"<code>}</code>",
|
||||
"Now give it a try yourself! Alter the <code>Car</code> <code>constructor</code> to use <code>parameters</code> to assign values to the <code>wheels</code>, <code>seats</code>, and <code>engines</code> properties.",
|
||||
"Then call your new <code>constructor</code> with three number <code>arguments</code> and assign it to <code>myCar</code> to see it in action."
|
||||
],
|
||||
"tests": [
|
||||
"assert((function(){var testCar = new Car(3,1,2); return testCar.wheels === 3 && testCar.seats === 1 && testCar.engines === 2;})(), 'message: Calling <code>new Car(3,1,2)</code> should produce an object with a <code>wheels</code> property of <code>3</code>, a <code>seats</code> property of <code>1</code>, and an <code>engines</code> property of <code>2</code>.');",
|
||||
"assert((function(){var testCar = new Car(4,4,2); return testCar.wheels === 4 && testCar.seats === 4 && testCar.engines === 2;})(), 'message: Calling <code>new Car(4,4,2)</code> should produce an object with a <code>wheels</code> property of <code>4</code>, a <code>seats</code> property of <code>4</code>, and an <code>engines</code> property of <code>2</code>.');",
|
||||
"assert((function(){var testCar = new Car(2,6,3); return testCar.wheels === 2 && testCar.seats === 6 && testCar.engines === 3;})(), 'message: Calling <code>new Car(2,6,3)</code> should produce an object with a <code>wheels</code> property of <code>2</code>, a <code>seats</code> property of <code>6</code>, and an <code>engines</code> property of <code>3</code>.');",
|
||||
"assert(typeof myCar.wheels === 'number' && typeof myCar.seats === 'number' && typeof myCar.engines === 'number', 'message: <code>myCar</code> should have number values for the <code>wheels</code>, <code>seats</code>, and <code>engines</code> properties.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var Car = function() {",
|
||||
" //Change this constructor",
|
||||
" this.wheels = 4;",
|
||||
" this.seats = 1;",
|
||||
" this.engines = 1;",
|
||||
"};",
|
||||
"",
|
||||
"//Try it out here",
|
||||
"var myCar;",
|
||||
"",
|
||||
"// Only change code above this line",
|
||||
"",
|
||||
"(function() {return JSON.stringify(myCar);})();"
|
||||
],
|
||||
"solutions": [
|
||||
"var Car = function(wheels,seats,engines) {\n this.wheels = wheels;\n this.seats = seats;\n this.engines = engines;\n};\n\nvar myCar = new Car(4,1,1);"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Crea objetos únicos pasando parámetros a la constructora",
|
||||
"descriptionEs": [
|
||||
"La <code>constructora</code> que tenemos es fabulosa, pero ¿qué hacer si no queremos crear siempre el mismo objeto?",
|
||||
"Para solucionar esto podemos añadir<code>parámetros</code>en nuestra <code>constructora</code>. Hacemos esto como en el siguiente ejemplo: ",
|
||||
"<code>var Carro = function (ruedas, asientos, motores) {</code>",
|
||||
"<code> this.ruedas = ruedas;</code>",
|
||||
"<code> this.asientos = asientos;</code>",
|
||||
"<code> this.motores = motores;</code>",
|
||||
"<code>};</code>",
|
||||
"Ahora podemos pasar <code>argumentos</code> cuando llamamos a nuestra <code>constructora</code>.",
|
||||
"<code>var miCarro = nuevo Carro(6, 3, 1); </code>",
|
||||
"Este código crea un objeto que utiliza los <code>argumentos</code> que pasamos en y se ve así:",
|
||||
"<code>{</code>",
|
||||
"<code> ruedas: 6,</code>",
|
||||
"<code> asientos: 3,</code>",
|
||||
"<code> motores: 1</code>",
|
||||
"<code>}</code>",
|
||||
"¡Ahora date una oportunidad a ti mismo! Modifica la <code>constructora</code> <code>Car</code> para que use <code>parámetros</code> que permitan asignar valores para las propiedades <code>wheels</code>, <code>seats</code>, y <code>engines</code>. ",
|
||||
"Entonces llama a tu nueva <code>constructora</code> con tres <code>argumentos</code> numéricos y asígnala a <code>myCar</code>para verla en acción."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb3bdef",
|
||||
"title": "Make Object Properties Private",
|
||||
"description": [
|
||||
"Objects have their own attributes, called <code>properties</code>, and their own functions, called <code>methods</code>.",
|
||||
"In the previous challenges, we used the <code>this</code> keyword to reference <code>public properties</code> of the current object.",
|
||||
"We can also create <code>private properties</code> and <code>private methods</code>, which aren't accessible from outside the object.",
|
||||
"To do this, we create the variable inside the <code>constructor</code> using the <code>var</code> keyword we're familiar with, instead of creating it as a <code>property</code> of <code>this</code>.",
|
||||
"This is useful for when we need to store information about an object but we want to control how it is used by outside code.",
|
||||
"For example, what if we want to store the <code>speed</code> our car is traveling at but we only want outside code to be able to modify it by accelerating or decelerating, so the speed changes in a controlled way?",
|
||||
"In the editor you can see an example of a <code>Car</code> <code>constructor</code> that implements this pattern.",
|
||||
"Now try it yourself! Modify the <code>Bike</code> <code>constructor</code> to have a <code>private property</code> called <code>gear</code> and two <code>public methods</code> called <code>getGear</code> and <code>setGear</code> to get and set that value."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof myBike.getGear !== 'undefined' && typeof myBike.getGear === 'function', 'message: The method <code>getGear</code> of <code>myBike</code> should be accessible outside the object.');",
|
||||
"assert(typeof myBike.setGear !== 'undefined' && typeof myBike.setGear === 'function', 'message: The method <code>setGear</code> of <code>myBike</code> should be accessible outside the object.');",
|
||||
"assert(typeof myBike.gear === 'undefined', 'message: <code>myBike.gear</code> should remain undefined.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var Car = function() {",
|
||||
" // this is a private variable",
|
||||
" var speed = 10;",
|
||||
"",
|
||||
" // these are public methods",
|
||||
" this.accelerate = function(change) {",
|
||||
" speed += change;",
|
||||
" };",
|
||||
"",
|
||||
" this.decelerate = function() {",
|
||||
" speed -= 5;",
|
||||
" };",
|
||||
"",
|
||||
" this.getSpeed = function() {",
|
||||
" return speed;",
|
||||
" };",
|
||||
"};",
|
||||
"",
|
||||
"var Bike = function() {",
|
||||
"",
|
||||
" // Only change code below this line.",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
" // Only change code above this line.",
|
||||
"};",
|
||||
"",
|
||||
"var myCar = new Car();",
|
||||
"",
|
||||
"var myBike = new Bike();"
|
||||
],
|
||||
"tail": [
|
||||
"if(myBike.hasOwnProperty('getGear')){(function() {return JSON.stringify(myBike.getGear());})();}"
|
||||
],
|
||||
"solutions": [
|
||||
"var Car = function() {\n var speed = 10;\n\n this.accelerate = function(change) {\n speed += change;\n };\n\n this.decelerate = function() {\n speed -= 5;\n };\n\n this.getSpeed = function() {\n return speed;\n };\n};\n\nvar Bike = function() {\n var gear = 1;\n \n this.getGear = function() {\n return gear;\n };\n \n this.setGear = function(newGear) {\n gear = newGear;\n };\n};\n\nvar myCar = new Car();\n\nvar myBike = new Bike();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Crea propiedades privadas de un objeto",
|
||||
"descriptionEs": [
|
||||
"Los objetos tienen sus propios atributos, llamados <code>propiedades</code>, y sus propias funciones, llamadas<code>métodos</code>.",
|
||||
"En los desafíos anteriores, se utilizó la palabra reservada <code>this</code> para referenciar <code>propiedades públicas</code>del objeto actual.",
|
||||
"También podemos crear <code>propiedades privadas</code> y <code>métodos privados</code>, que no son accesibles desde fuera del objeto.",
|
||||
"Para ello, creamos la variable dentro de la <code>constructora</code> usando la palabra reservada <code>var</code>, con la cual ya estamos familiarizados, en lugar de crearla con <code>this</code>. ",
|
||||
"Esto es útil cuando necesitamos almacenar información sobre un objeto, pero controlando como se usa en el código externo al objeto.",
|
||||
"Por ejemplo, ¿qué pasa si queremos almacenar la <code>velocidad</code> con la cual se desplaza nuestro carro, pero queremos que el código externo pueda modificarla sólo acelerando o desacelerando, de forma que la velocidad cambie de una manera controlada?",
|
||||
"En el editor se puede ver un ejemplo de una <code>constructora</code> de <code>Car</code> que implementa este patrón.",
|
||||
"¡Ahora pruébalo tú mismo! Modifica la <code>constructora</code> <code>Bike</code> para tener una <code>propiedad privada</code> llamada <code>gear</code>y dos<code>métodos públicos</code> llamados <code>getGear</code>y<code>setGear</code> para obtener y establecer ese valor."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb7bdef",
|
||||
"title": "Iterate over Arrays with .map",
|
||||
"description": [
|
||||
"The <code>map</code> method is a convenient way to iterate through arrays. Here's an example usage:",
|
||||
"<code>var timesFour = oldArray.map(function(val){</code>",
|
||||
"<code> return val * 4;</code>",
|
||||
"<code>});</code>",
|
||||
"",
|
||||
"The <code>map</code> method will iterate through every element of the array, creating a new array with values that have been modified by the callback function, and return it.",
|
||||
"In our example the callback only uses the value of the array element (the <code>val</code> argument) but your callback can also include arguments for the <code>index</code> and <code>array</code> being acted on.",
|
||||
"Use the map function to add 3 to every value in the variable <code>oldArray</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(newArray, [4,5,6,7,8], 'message: You should add three to each value in the array.');",
|
||||
"assert(editor.getValue().match(/\\.map\\s*\\(/gi), 'message: You should be making use of the <code>map</code> method.');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\]/gi), 'message: You should only modify the array with <code>map</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var oldArray = [1,2,3,4,5];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var newArray = oldArray;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() {return newArray;})();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Iterar sobre vectores con .map",
|
||||
"descriptionEs": [
|
||||
"El método <code>map</code> es una manera conveniente de iterar sobre vectores. He aquí un ejemplo de uso: ",
|
||||
"<code>var porCuatro = vectorAntiguo.map(function(val){</code>",
|
||||
"<code> return val * 4;</code>",
|
||||
"<code>});</code>",
|
||||
"",
|
||||
"El método <code>map</code> iterará sobre cada elemento del vector, creando un nuevo vector con los valores modificados por la función de devolución de llamada (<em>callback</em>) y retornará ese nuevo arreglo.",
|
||||
"En nuestro ejemplo, la función de devolución de llamada sólo usa el valor del elemento del vector sobre el que está iterando (parámetro <code>val</code>), pero tu función de devolución de llamada también puede incluir parámetros para el <code>índice</code> y el <code>vector</code> completo. ",
|
||||
"Usa la función <code>map</code> para añadir 3 a cada valor de la variable <code>oldArray</code>."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb8bdef",
|
||||
"title": "Condense arrays with .reduce",
|
||||
"description": [
|
||||
"The array method <code>reduce</code> is used to iterate through an array and condense it into one value.",
|
||||
"To use <code>reduce</code> you pass in a callback whose arguments are an accumulator (in this case, <code>previousVal</code>) and the current value (<code>currentVal</code>).",
|
||||
"<code>reduce</code> has an optional second argument which can be used to set the initial value of the accumulator. If no initial value is specified it will be the first array element and <code>currentVal</code> will start with the second array element.",
|
||||
"Here is an example of <code>reduce</code> being used to subtract all the values of an array:",
|
||||
"<code>var singleVal = array.reduce(function(previousVal, currentVal) {</code>",
|
||||
"<code> return previousVal - currentVal;</code>",
|
||||
"<code>}, 0);</code>",
|
||||
"Use the <code>reduce</code> method to sum all the values in <code>array</code> and assign it to <code>singleVal</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert(singleVal == 30, 'message: <code>singleVal</code> should be equal to the sum of all items in the <code>array</code> variable.');",
|
||||
"assert(editor.getValue().match(/\\.reduce\\s*\\(/gi), 'message: You should have made use of the <code>reduce</code> method.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var array = [4,5,6,7,8];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var singleVal = array;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() {return singleVal;})();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Condensa vectores con .reduce",
|
||||
"descriptionEs": [
|
||||
"El método <code>reduce</code> de un vector, se utiliza para iterar a través del vector y condensarlo en un valor.",
|
||||
"Para usar <code>reduce</code> tu le pasas una función de devolución de llamada cuyos argumentos sean un acumulador (en este caso, <code>valorPrevio</code>) y el valor actual (<code>valorActual</code>). ",
|
||||
"<code>reduce</code> tiene un argumento opcional que puede usarse para asignar un valor inicial al acumulador. Si no se especifica ningún valor inicial será el primer elemento del vector y <code>valorActual</code> comenzará en el segundo elemento del vector. ",
|
||||
"He aquí un ejemplo de<code>reduce</code> cuando se utiliza para restar todos los valores de una matriz:",
|
||||
"<code>var singleVal = array.reduce(function(valorAnterior, valorActual) {</code>",
|
||||
"<code> return valorAnterior - valorActual;</code>",
|
||||
"<code>}, 0);</code>",
|
||||
"Usa el método <code>reduce</code> para sumar todos los valores en <code>array</code> y asignarlo a <code>singleVal</code>."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c15feddfaeb9bdef",
|
||||
"title": "Filter Arrays with .filter",
|
||||
"description": [
|
||||
"The <code>filter</code> method is used to iterate through an array and filter out elements where a given condition is not true.",
|
||||
"<code>filter</code> is passed a callback function which takes the current value (we've called that <code>val</code>) as an argument.",
|
||||
"Any array element for which the callback returns true will be kept and elements that return false will be filtered out.",
|
||||
"The following code is an example of using <code>filter</code> to remove array elements that are equal to five:",
|
||||
"Note: We omit the second and third arguments since we only need the value",
|
||||
"<code>array = array.filter(function(val) {</code>",
|
||||
"<code> return val !== 5;</code>",
|
||||
"<code>});</code>",
|
||||
"Use <code>filter</code> to remove all elements from <code>array</code> that are greater than 5."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(newArray, [1,2,3,4,5], 'message: You should have removed all the values from the array that are greater than 5.');",
|
||||
"assert(editor.getValue().match(/array\\.filter\\s*\\(/gi), 'message: You should be using the <code>filter</code> method to remove the values from the array.');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7\\,8\\,9\\,10\\]/gi), 'message: You should only be using <code>filter</code> to modify the contents of the array.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var oldArray = [1,2,3,4,5,6,7,8,9,10];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var newArray = oldArray;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() { return newArray; })();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Filtrar vectores con .filter",
|
||||
"descriptionEs": [
|
||||
"El método <code>filter</code> se utiliza para iterar a través de un vector y filtrar los elementos que hagan falsa un condición determinada.",
|
||||
"<code>filter</code> recibe una función de devolución de llamada que a su vez recibe como argumento el valor actual (que hemos llamado que<code>val </code>).",
|
||||
"Cualquier elemento del vector para el cual la función de devolución de llamada retorne <code>true</code> se mantendrá y los elementos que devuelven <code>false</code> serán filtrados.",
|
||||
"El código siguiente es un ejemplo del uso del <code>filter</code> para eliminar los elementos de un vector que no sean números pares:",
|
||||
"Nota: Omitimos el segundo y tercer argumentos ya que sólo necesitamos el valor",
|
||||
"<code>array = array.filter(function(val) {</code>",
|
||||
"<code> return val % 2 === 0;</code>",
|
||||
"<code>});</code>",
|
||||
"Usa <code>filter</code> para eliminar todos los elementos de <code>array</code>que sean mayores que 5."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb1bdef",
|
||||
"title": "Sort Arrays with .sort",
|
||||
"description": [
|
||||
"You can use the method <code>sort</code> to easily sort the values in an array alphabetically or numerically.",
|
||||
"Unlike the previous array methods we have been looking at, <code>sort</code> actually alters the array in place. However, it also returns this sorted array.",
|
||||
"<code>sort</code> can be passed a compare function as a callback. If no compare function is passed in it will convert the values to strings and sort alphabetically.",
|
||||
"Here is an example of using sort with a compare function that will sort the elements from smallest to largest number:",
|
||||
"<code>var array = [1, 12, 21, 2];</code>",
|
||||
"<code>array.sort(function(a, b) {</code>",
|
||||
"<code> return a - b;</code>",
|
||||
"<code>});</code>",
|
||||
"Use <code>sort</code> to sort <code>array</code> from largest to smallest."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(array, [21, 12, 2, 1], 'message: You should have sorted the array from largest to smallest.');",
|
||||
"assert(editor.getValue().match(/\\[1,\\s*12,\\s*21,\\s*2\\];/gi), 'message: You should only be using <code>sort</code> to modify the array.');",
|
||||
"assert(editor.getValue().match(/\\.sort\\s*\\(/g), 'message: You should have made use of the <code>sort</code> method.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var array = [1, 12, 21, 2];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"array.sort();",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() { return array; })();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Ordena vectores con .sort",
|
||||
"descriptionEs": [
|
||||
"Puedes utilizar el método <code>sort</code> para ordenar alfabética o numéricamente los valores de un vector.",
|
||||
"A diferencia de los métodos de vector que hemos visto,<code>sort</code>en realidad altera el vector en su lugar. Sin embargo, también devuelve este vector ordenado. ",
|
||||
"<code>sort</code> puede recibir como parámetro una función de devolución de llamada para comparar. Sin no se provee una función de comparación, convertirá los valores a cadenas y los ordenará alfabéticamente. ",
|
||||
"He aquí un ejemplo del uso de <code>sort</code> con una función de comparación que ordena los elementos de menor a mayor:",
|
||||
"<code>var array = [1, 12, 21, 2];</code>",
|
||||
"<code>array.sort(function(a, b) {</code>",
|
||||
"<code> return a - b;</code>",
|
||||
"<code>});</code>",
|
||||
"Usa <code>sort</code> para ordenar<code>array</code> de mayor a menor."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb2bdef",
|
||||
"title": "Reverse Arrays with .reverse",
|
||||
"description": [
|
||||
"You can use the <code>reverse</code> method to reverse the elements of an array.",
|
||||
"<code>reverse</code> is another array method that alters the array in place, but it also returns the reversed array.",
|
||||
"Use <code>reverse</code> to reverse the <code>array</code> variable and assign it to <code>newArray</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(newArray, [7,6,5,4,3,2,1], 'message: You should reverse the array.');",
|
||||
"assert(editor.getValue().match(/\\.reverse\\s*\\(\\)/gi), 'message: You should use the <code>reverse</code> method.');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\,4\\,5\\,6\\,7/gi), 'message: You should only be using <code>reverse</code> to modify <code>array</code>.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var array = [1,2,3,4,5,6,7];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var newArray = array;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
""
|
||||
],
|
||||
"tail": [
|
||||
"(function() {return newArray;})();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Invierte vectores con .reverse",
|
||||
"descriptionEs": [
|
||||
"Puedes utilizar el método <code>reverse</code> para invertir los elementos en un vector.",
|
||||
"<code>reverse</code> es otro método de vector que altera el vector mismo, y también devuelve el vector invertido.",
|
||||
"Usa <code>reverse</code> para invertir la variable <code>array</code> y asignarla a <code>newArray</code>."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb3bdef",
|
||||
"title": "Concatenate Arrays with .concat",
|
||||
"description": [
|
||||
"<code>concat</code> can be used to merge the contents of two arrays into one.",
|
||||
"<code>concat</code> takes an array as an argument and returns a new array with the elements of this array concatenated onto the end.",
|
||||
"Here is an example of <code>concat</code> being used to concatenate <code>otherArray</code> onto the end of <code>oldArray</code>:",
|
||||
"<code>newArray = oldArray.concat(otherArray);</code>",
|
||||
"Use <code>.concat()</code> to concatenate <code>concatMe</code> onto the end of <code>oldArray</code> and assign it to <code>newArray</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert.deepEqual(newArray, [1,2,3,4,5,6], 'message: You should concatenate the two arrays together.');",
|
||||
"assert(editor.getValue().match(/\\.concat\\s*\\(/gi), 'message: You should be using the <code>concat</code> method to merge the two arrays.');",
|
||||
"assert(editor.getValue().match(/\\[1\\,2\\,3\\]/gi) && editor.getValue().match(/\\[4\\,5\\,6\\]/gi), 'message: You should only be using <code>concat</code> to modify the arrays.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var oldArray = [1,2,3];",
|
||||
"",
|
||||
"var concatMe = [4,5,6];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var newArray = oldArray;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() { return newArray; })();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Concatena vectores con .concat",
|
||||
"descriptionEs": [
|
||||
"<code>concat</code> se puede utilizar para combinar el contenido de dos vectores en uno solo.",
|
||||
"<code>concat</code> recibe un vector como argumento y devuelve un nuevo vector con los elementos del vector que recibe concatenados al final.",
|
||||
"He aquí un ejemplo de <code>concat</code> cuando se usa para concatenar <code>otroVector</code> al final de <code>vectorAntiguo</code>:",
|
||||
"<code>vectorNuevo = vectorAntiguo.concat(otroVector);</code>",
|
||||
"Usa <code>.concat ()</code> para concatenar <code>concatMe</code> al final de <code>oldArray</code>y asigna el vector resultante a <code>newArray</code>."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb4bdef",
|
||||
"title": "Split Strings with .split",
|
||||
"description": [
|
||||
"You can use the <code>split</code> method to split a string into an array.",
|
||||
"<code>split</code> uses the argument you pass in as a delimiter to determine which points the string should be split at.",
|
||||
"Here is an example of <code>split</code> being used to split an array at every <code>s</code> character:",
|
||||
"<code>var array = string.split('s');</code>",
|
||||
"Use <code>split</code> to create an array of words from <code>string</code> and assign it to <code>array</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert(/\\.split\\(/gi, 'message: You should use the <code>split</code> method on the string.');",
|
||||
"assert(typeof array === 'object' && array.length === 5, 'message: You should split the string by its spaces.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var string = \"Split me into an array\";",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var array = string;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() {return array;})();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Divide cadenas con .split",
|
||||
"descriptionEs": [
|
||||
"Puedes utilizar el método <code>split</code> para dividir una cadena en un vector.",
|
||||
"<code>split</code> utiliza el argumento que recibe como delimitador para determinar en qué puntos debe dividir la cadena.",
|
||||
"He aquí un ejemplo del uso de <code>split</code> para dividir una cadena en cada caracter <code>s</code>:",
|
||||
"<code>var vector = string.split('s');</code>",
|
||||
"Usa <code>split</code> para crear un vector con las palabras de una <code>cadena</code> y asígnalo a la variable <code>array</code>."
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cf1111c1c16feddfaeb5bdef",
|
||||
"title": "Join Strings with .join",
|
||||
"description": [
|
||||
"We can use the <code>join</code> method to join each element of an array into a string separated by whatever delimiter you provide as an argument.",
|
||||
"The following is an example of using <code>join</code> to join all of the elements of an array into a string with all the elements separated by word `Na`:",
|
||||
"<code>var joinMe = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>",
|
||||
"<code>var joinedString = joinMe.join(\"Na \");</code>",
|
||||
"<code>console.log(joinedString);</code>",
|
||||
"Use the <code>join</code> method to create a string from <code>joinMe</code> with spaces in between each element and assign it to <code>joinedString</code>."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof joinedString === 'string' && joinedString === \"Split me into an array\", 'message: You should join the elements of the array with spaces.');",
|
||||
"assert(/\\.join\\(/gi, 'message: You should use of the <code>join</code> method on the array.');"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"var joinMe = [\"Split\",\"me\",\"into\",\"an\",\"array\"];",
|
||||
"",
|
||||
"// Only change code below this line.",
|
||||
"",
|
||||
"var joinedString = joinMe;",
|
||||
"",
|
||||
"// Only change code above this line.",
|
||||
"",
|
||||
"(function() {return joinedString;})();"
|
||||
],
|
||||
"challengeType": 1,
|
||||
"type": "waypoint",
|
||||
"nameEs": "Une cadenas con .join",
|
||||
"descriptionEs": [
|
||||
"Podemos usar el método <code>join</code> para unir los elementos de un vector en una cadena, separandolos con el delimitador que proporciones como argumento.",
|
||||
"El siguiente es un ejemplo del uso de <code>join</code> para unir todos los elementos de un vector en una cadena con todos los elementos separados entre si por palabra` Na`: ",
|
||||
"<code>var uneme = [\"Na \", \"Na \", \"Na \", \"Na \", \"Batman!\"];</code>",
|
||||
"<code>var cadenaUnida = uneme.join(\"Na \");</code>",
|
||||
"<code>console.log(cadenaUnida);</code>",
|
||||
"Usa el método <code>join</code> para crear una cadena a partir <code>joinMe</code> con espacios entre cada par de elementos y asignarla a <code>joinedString </code>."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user