Home
Javascript Fundamentals
# Javascript basics
# Javascript arrays
# Javascript objects
# Javascript dates
# Javascript Sets
Javascript DOM
# DOM selector methods
# Events and user interactions
# DOM manipulation
# DOM fundamentals
# Recursive functions
Challenge Rush
Random Challenge
// Write a function that takes an object as argument// Somehow, the properties and keys of the object got mixed up// Swap the Javascript object's key with its values and return the resulting object function myFunction ( obj ) { return }
return
myFunction({z:'a',y:'b',x:'c',w:'d'})
{a:'z',b:'y',c:'x',d:'w'}
myFunction({2:'a',4:'b',6:'c',8:'d'})
{a:'2',b:'4',c:'6',d:'8'}
myFunction({a:1,z:24})
{1:'a',24:'z'}