Get help on our basic JavaScript and Algorithms Challenges. If you are posting code that is large use Gist - https://gist.github.com/ paste the link here.
thecodingaviator on master
remove A (#31157) (compare)
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "when i saw a " + myAdjective + myNoun + "i " + myVerb + myAdverb;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog ", "big ", "ran ", "quickly ");
:star2: 1826 | @blauelf |http://www.freecodecamp.com/blauelf
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function lookUpProfile(firstName, prop){
// Only change code below this line
for(i=0;i<contact.length;i++)
// Only change code above this line
}
// Change these values to test your function
lookUpProfile("Akira", "likes");
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "when i saw a " + myAdjective + myNoun + "i " + myVerb + myAdverb;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog ", "big ", "ran ", "quickly ");
Caesars cipher
function rot13(str) { // LBH QVQ VG!
for(var i=0;i<str.length;i++) {
if(str.charCodeAt(i) >= 65 && str.charCodeAt(i) <= 90) {
if(str.charCodeAt(i) < 78) {
str[i] = String.fromCharCode(str.charCodeAt(i) + 13);
}
else {
str[i] = String.fromCharCode(str.charCodeAt(i) - 13);
}
}
}
return str;
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
what is the problem?
TypeError: Cannot assign to read only property '0' of string 'SERR PBQR PNZC'
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "when i saw a " + myAdjective+ "" + myNoun + "i " + myVerb + "" + myAdverb;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
:cookie: 258 | @adityaparab |http://www.freecodecamp.com/adityaparab
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
result = "when i saw a " + myAdjective + "" + myNoun + "i " + myVerb + "" + myAdverb;
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
Thanks @Athaman :)
Call the processArg function with an argument of 7 and assign its return value to the variable processed.
// Example
var changed = 0;
function change(num) {
return (num + 5) / 3;
}
changed = change(10);
// Setup
var processed = 0;
function processArg(num) {
return (num + 3) / 5;
}
// Only change code below this line
processArg(7);
return processed;
:cookie: 407 | @athaman |http://www.freecodecamp.com/athaman