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)
```js ⇦ Type 3 backticks and then press [shift + enter ⏎]
(type js or html or css)
<paste your code here>,
then press [shift + enter ⏎]
``` ⇦ Type 3 backticks, then press [enter ⏎]
This an inline `<paste code here>
` code formatting with a single backtick() at _start_ and _end_ around the
code`.
See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics
Hi all, I'm trying to split each word of a string into seperate arrays of alphabets, within a larger array of the whole string. What I'm looking for is this ["I","'","m"] ["a"]["l","i","t","t","l","e"]...you get the point,
but I'm stumped on how to split the words, can anybody help?
```
function titleCase(str) {
var splitOnce = str.split(" ");
for (var i=0; i <splitOnce.length; i++){
var splitTwice = splitOnce[[i][i]].split("");
return splitTwice;
}
}
titleCase("I'm a little tea pot");
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line
"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");
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");