Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
69dfab0
Completed first task
Jul 15, 2025
edd7a32
Moving on from Second task: JS beginner task took too long will come …
Jul 22, 2025
37ac66a
functions getGreeting and ageOneYear done
Jul 28, 2025
6c12332
finished make Object and getPropertyValue
Jul 28, 2025
6bf1074
Completed functions deleteProperty and addName using the method Objec…
Jul 28, 2025
80496f1
Finished function returnErrorIfFalsy and getKeys
Jul 29, 2025
e26acd0
finished function makeArrayOfItem and makeArrayOfItems
Jul 29, 2025
09c2476
finished functions hasItem and getItemAtIndex
Jul 30, 2025
a611c88
finished functions insertItemAtIndex and replaceItemAtIndex as well a…
Jul 30, 2025
77542a2
finished function deleteItemAtIndex keep runing into runing errors wi…
Jul 31, 2025
083cd85
Finished functions getType, isNumber and toNumber
Jul 31, 2025
f43bf1a
Completed functions isStringNumber, add, addStrings, addStringsOrNumb…
Oct 1, 2025
d37edd2
Function countIf completed
Oct 7, 2025
163d43b
Function filterStringsWithCommas completed
Oct 31, 2025
18cd42d
function splitStringByCommas completed
Oct 31, 2025
a8f930b
moved on to task 4 to learn React. will get back to jsKata (stopped o…
Nov 4, 2025
c8e746e
React task started, created dog component
Nov 4, 2025
dba7944
Subtitles Implemented for react task
Nov 5, 2025
5f11970
Sucessfully added photo to all components
Nov 5, 2025
ca79732
More dogs ( + pictures ) added!
Nov 6, 2025
50de1a5
Doglist implemented, not tested
Nov 6, 2025
36f88f1
Array made and passed, unfortunately there is a runtime error
Nov 6, 2025
68277d8
Lol fix, was passing the whole object instead of it's elements into t…
Nov 6, 2025
ff72c75
First Project started
Nov 10, 2025
9fa2a69
First Component Rendered
Nov 10, 2025
50725b8
css tailwind configured, first working text implemented
Nov 10, 2025
67236b6
Images Implemented
Nov 14, 2025
c38b2f9
Text and Image Formatting introduced. BulletPoints added. I'm going t…
Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.codeActionsOnSave": { "source.fixAll.eslint": true },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": "active",
"[javascript]": {
Expand Down
89 changes: 76 additions & 13 deletions 3-JSKata/1-objects-and-arrays/kata.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,84 @@

// getGreeting should return a string containing
// 'Hello ' and the contents of `name`
function getGreeting(name) {}
function getGreeting(name) {
return 'Hello ' + name
}

// ageOneYear should return a new object with an `age` property 1 greater
// than the `age` property of `obj`
function ageOneYear(obj) {}
function ageOneYear(obj) {
const newObj = {
name: 'Mickey Mouse',
age: obj.age + 1,
email: 'mickey@disney.com',
}

return newObj
}

// makeObject should return an object that looks like this:
// (but using the arguments passed to the function)
// {
// key: value
// }
function makeObject(key, value) {}
function makeObject(key, value) {
const newObj = {}

newObj[key] = value

return newObj
}

// getPropertyValue should return the value of the
// property contained in the `key` of `obj`
function getPropertyValue(obj, key) {}
function getPropertyValue(obj, key) {
return obj[key]
}

// addName should return a copy of `obj` with the addition of a `name`
// property that has the value of the `name` argument
// Tip: consider the object literal spread syntax
function addName(obj, name) {}
function addName(obj, name) {
const objectAddName = Object.assign({}, obj)

objectAddName.name = name

return objectAddName
}

// deleteProperty should return a new copy of `obj` without the property name
// that matches the `key` parameter
// Tip: consider JavaScript's `delete` operator
function deleteProperty(obj, key) {}
function deleteProperty(obj, key) {
const objectDeleteProperty = Object.assign({}, obj)

delete objectDeleteProperty[key]

return objectDeleteProperty
}

// returnErrorIfFalsy should return a JavaScript Error object with message:
// 'Oh no, an error!'
// if val evaluates to false
// Tip: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
function returnErrorIfFalsy(val) {}
function returnErrorIfFalsy(val) {
if (val == false) {
return new Error('Oh no, an error!')
}
}

// keys should return an array of the object's property names (keys)
// For example, given { foo: 1, bar: 2 } it would return ['foo', 'bar']
function getKeys(obj) {}
function getKeys(obj) {
return Object.keys(obj)
}

// getValues should return an array of the object's own values
// For example, given { foo: 1, bar: 2 } it would return [1, 2]
function getValues(obj) {}
function getValues(obj) {
return Object.values(obj)
}

/**
* Arrays
Expand All @@ -52,20 +90,45 @@ function getValues(obj) {}
// makeArrayOfItem should return an array that is `length` long, made up of
// `item`. For example, makeArrayOfItem('foo', 2) would return:
// ['foo', 'foo']
function makeArrayOfItem(item, length) {}
function makeArrayOfItem(item, length) {
const myArray = []

for (let i = 0; i < length; i++) {
myArray.push(item)
}

return myArray
}

// makeArrayOfItems should return an array containing all arguments passed to it
// Tip: consider JavaScript's Rest parameters
function makeArrayOfItems() {}
function makeArrayOfItems(...item) {
return item // Using the rest Parameter, it captures everything and stores it in an array
}

// hasItem should return true if `item` is present in `arr` at least once,
// otherwise it should return false.
// Tip: there is an array function that makes this straightforward
function hasItem(arr, item) {}
function hasItem(arr, item) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] == item) {
return true
} else {
return false
}
}
}

// getItemAtIndex should return arr[idx] but only if that index exists:
// if it doesn't, return a JavaScript Error object.
function getItemAtIndex(arr, idx) {}
function getItemAtIndex(arr, idx) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] == arr[idx]) {
return arr[i]
}
}
return new Error()
}

// replaceItemAtIndex should return a copy of `arr` with
// the element at `idx` replaced with `item`
Expand Down
Loading