From 350bd0417ace96278f632c0c86a87855afbbf249 Mon Sep 17 00:00:00 2001 From: name Date: Wed, 27 Jul 2022 13:25:16 -0700 Subject: [PATCH 1/4] deploy --- linked list/README.md | 13 +++++++++++++ linked list/add.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 linked list/README.md create mode 100644 linked list/add.md diff --git a/linked list/README.md b/linked list/README.md new file mode 100644 index 00000000..c5a9dcc3 --- /dev/null +++ b/linked list/README.md @@ -0,0 +1,13 @@ +# Linked Lists + +In all programming languages, there are data structures. One of these data structures are called Linked Lists. There is no built in method or function for Linked Lists in Javascript so you will have to implement it yourself. + +A Linked List is very similar to a normal array in Javascript, it just acts a little bit differently. + +In this chapter, we will go over the different ways we can implement a Linked List. + +Here's an example of a Linked List: + +``` +["one", "two", "three", "four"] +``` diff --git a/linked list/add.md b/linked list/add.md new file mode 100644 index 00000000..cc920440 --- /dev/null +++ b/linked list/add.md @@ -0,0 +1,32 @@ +# Add + +What we will do first is add a value to a Linked List. + +```js +class Node { + constructor(data) { + this.data = data + this.next = null + } +} + +class LinkedList { + constructor(head) { + this.head = head + } + + append = (value) => { + const newNode = new Node(value) + let current = this.head + + if (!this.head) { + this.head = newNode + return + } + + while (current.next) { + current = current.next + } + current.next = newNode + } +} From 5462a898cbac8fce80b4b98badb65aa1c06c49e3 Mon Sep 17 00:00:00 2001 From: name Date: Thu, 28 Jul 2022 19:28:30 -0700 Subject: [PATCH 2/4] deploy --- arrays/push.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arrays/push.md diff --git a/arrays/push.md b/arrays/push.md new file mode 100644 index 00000000..e63fc63c --- /dev/null +++ b/arrays/push.md @@ -0,0 +1,10 @@ +# Push + +You can push certain items to an array making the last index the item you just added. + +```javascript +var array = [1, 2, 3]; + +array.push(4); + +console.log(array); From 0b51eb1eee50c1f0a7d86fe42ffffe40bf0c3220 Mon Sep 17 00:00:00 2001 From: name Date: Thu, 28 Jul 2022 19:33:04 -0700 Subject: [PATCH 3/4] deploy --- arrays/shift.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 arrays/shift.md diff --git a/arrays/shift.md b/arrays/shift.md new file mode 100644 index 00000000..64e01319 --- /dev/null +++ b/arrays/shift.md @@ -0,0 +1,10 @@ +# Shift + +What Shift does to an array is delete the first index of that array and move all indexes to the left. + +```javascript +var array = [1, 2, 3]; + +array.shift(); + +console.log(array); From cd87196b59fb56ba43b61f9fa53d78f8ec294aef Mon Sep 17 00:00:00 2001 From: name Date: Fri, 5 Aug 2022 12:12:50 -0700 Subject: [PATCH 4/4] deploy --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b5a5a635..ec2574e1 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,6 @@ This book will teach you the basics of programming and Javascript. Whether you a ![](./assets/intro.png) -JavaScript (_JS for short_) is the programming language that enables web pages to respond to user interaction beyond the basic level. It was created in 1995, and is today one of the most famous and used programming languages. +JavaScript, often abbreviated JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. + +Do not confuse JavaScript with the Java programming language. Both "Java" and "JavaScript" are trademarks or registered trademarks of Oracle in the U.S. and other countries. However, the two programming languages have very different syntax, semantics, and use.