Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

// Write a function that takes two strings (a and b) as arguments // If a contains b, append b to the beginning of a // If not, append it to the end // Return the concatenation

// Write a function that takes two strings (a and b) as arguments
// If a contains b, append b to the beginning of a
// If not, append it to the end
// Return the concatenation
function
myFunction(a, b) {
return a.includes(b) ? b + a : a + b;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to setItem and getItem in javascript in localStorage 
Javascript :: check if element is last child jquery 
Javascript :: payload too large nodejs 
Javascript :: update all dependencies npm 
Javascript :: split a string every n characters javascript 
Javascript :: read json file javascript 
Javascript :: Another debugger is already connected Rn @ bundle.js:10 
Javascript :: node js utf8 encode 
Javascript :: com.fasterxml.jackson.databind.exc.unrecognizedpropertyexception unrecognized field 
Javascript :: jQuery search immediate children 
Javascript :: how to disable mouse right click in html page 
Javascript :: has not class jquery 
Javascript :: remove blank space javascript 
Javascript :: onchange text input react native 
Javascript :: remove stack header bottom line react native 
Javascript :: vue check if list is empty 
Javascript :: sequelize find one 
Javascript :: vscode default indent type 
Javascript :: regex only letters not spaces 
Javascript :: jquery text replace 
Javascript :: how to get element in iframe using javascript 
Javascript :: get attribute value jquery 
Javascript :: pdf dark 
Javascript :: javascript int with commas 
Javascript :: node open file 
Javascript :: js check query string 
Javascript :: jquery test div exists 
Javascript :: nodejs get response time 
Javascript :: chart js y axis integer 
Javascript :: body on click function 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =