<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rishabh-14</title>
    <description>The latest articles on DEV Community by Rishabh-14 (@rishabh14).</description>
    <link>https://dev.to/rishabh14</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F920954%2F0be9259b-a187-43bd-aa78-e930c85c485c.png</url>
      <title>DEV Community: Rishabh-14</title>
      <link>https://dev.to/rishabh14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rishabh14"/>
    <language>en</language>
    <item>
      <title>Javascript cheatsheet 2023 : Part 1</title>
      <dc:creator>Rishabh-14</dc:creator>
      <pubDate>Sat, 04 Feb 2023 13:45:18 +0000</pubDate>
      <link>https://dev.to/rishabh14/javascript-cheatsheet-2023-part-1-2l6g</link>
      <guid>https://dev.to/rishabh14/javascript-cheatsheet-2023-part-1-2l6g</guid>
      <description>&lt;p&gt;Github link - [&lt;a href="https://github.com/Rishabh-14/Javascript-cheatsheet/blob/master/README.md" rel="noopener noreferrer"&gt;https://github.com/Rishabh-14/Javascript-cheatsheet/blob/master/README.md&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;Variables:&lt;br&gt;
Declare variables to store values in JavaScript.&lt;/p&gt;

&lt;p&gt;var name = "John";&lt;/p&gt;

&lt;p&gt;Data Types:&lt;br&gt;
There are several data types in JavaScript like string, number, boolean, etc.&lt;/p&gt;

&lt;p&gt;var name = "John";&lt;br&gt;
var age = 30;&lt;br&gt;
var isMarried = true;&lt;/p&gt;

&lt;p&gt;Arrays:&lt;br&gt;
Arrays are used to store multiple values in a single variable.&lt;br&gt;
css&lt;/p&gt;

&lt;p&gt;var names = ["John", "Jane", "Jim"];&lt;/p&gt;

&lt;p&gt;Objects:&lt;br&gt;
Objects are used to store multiple values as key-value pairs.&lt;br&gt;
yaml&lt;/p&gt;

&lt;p&gt;var person = {&lt;br&gt;
  name: "John",&lt;br&gt;
  age: 30,&lt;br&gt;
  isMarried: true&lt;br&gt;
};&lt;/p&gt;

&lt;p&gt;Functions:&lt;br&gt;
Functions are blocks of code that can be executed whenever needed.&lt;br&gt;
scss&lt;/p&gt;

&lt;p&gt;function sayHello() {&lt;br&gt;
  console.log("Hello World!");&lt;br&gt;
}&lt;br&gt;
sayHello();&lt;/p&gt;

&lt;p&gt;Conditional Statements:&lt;br&gt;
Conditional statements are used to execute code based on certain conditions.&lt;/p&gt;

&lt;p&gt;var age = 30;&lt;br&gt;
if (age &amp;gt;= 18) {&lt;br&gt;
  console.log("You are an adult.");&lt;br&gt;
} else {&lt;br&gt;
  console.log("You are a minor.");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Loops:&lt;br&gt;
Loops are used to repeat a block of code multiple times.&lt;br&gt;
css&lt;/p&gt;

&lt;p&gt;for (var i = 0; i &amp;lt; 5; i++) {&lt;br&gt;
  console.log("Hello World!");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Events:&lt;br&gt;
Events are actions that trigger JavaScript code.&lt;/p&gt;

&lt;p&gt;document.getElementById("myButton").addEventListener("click", function() {&lt;br&gt;
  console.log("Button was clicked.");&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;DOM Manipulation:&lt;br&gt;
The Document Object Model (DOM) can be manipulated using JavaScript.&lt;/p&gt;

&lt;p&gt;document.getElementById("myDiv").innerHTML = "Hello World!";&lt;/p&gt;

&lt;p&gt;AJAX:&lt;br&gt;
AJAX is used to make asynchronous requests to a server.&lt;/p&gt;

&lt;p&gt;var xhr = new XMLHttpRequest();&lt;br&gt;
xhr.open("GET", "data.txt", true);&lt;br&gt;
xhr.onreadystatechange = function() {&lt;br&gt;
  if (xhr.readyState === 4 &amp;amp;&amp;amp; xhr.status === 200) {&lt;br&gt;
    console.log(xhr.responseText);&lt;br&gt;
  }&lt;br&gt;
};&lt;br&gt;
xhr.send();&lt;/p&gt;

&lt;p&gt;JSON:&lt;br&gt;
JSON is used to exchange data between a server and a client.&lt;/p&gt;

&lt;p&gt;var person = {&lt;br&gt;
  name: "John",&lt;br&gt;
  age: 30,&lt;br&gt;
  isMarried: true&lt;br&gt;
};&lt;br&gt;
var personJSON = JSON.stringify(person);&lt;br&gt;
console.log(personJSON);&lt;/p&gt;

&lt;p&gt;Regular Expressions:&lt;br&gt;
Regular expressions are used to match patterns in strings.&lt;br&gt;
typescript&lt;/p&gt;

&lt;p&gt;var pattern = /\d/;&lt;br&gt;
var string = "123";&lt;br&gt;
var result = pattern.test(string);&lt;br&gt;
console.log(result);&lt;/p&gt;

&lt;p&gt;Error Handling:&lt;br&gt;
Error handling is used to handle errors in JavaScript code.&lt;br&gt;
vbnet&lt;/p&gt;

&lt;p&gt;try {&lt;br&gt;
  console.log(undefinedVariable);&lt;br&gt;
} catch (error) {&lt;br&gt;
  console.error(error);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Template Literals:&lt;br&gt;
Template literals are used to embed expressions in string literals.&lt;/p&gt;

&lt;p&gt;var name = "John";&lt;br&gt;
var message = &lt;code&gt;Hello, ${name}!&lt;/code&gt;;&lt;br&gt;
console.log(message);&lt;/p&gt;

&lt;p&gt;Arrow Functions:&lt;br&gt;
Arrow functions are a shorthand for defining functions in JavaScript.&lt;/p&gt;

&lt;p&gt;var sayHello = () =&amp;gt; console.log("Hello World!");&lt;br&gt;
sayHello();&lt;/p&gt;

&lt;p&gt;Spread Operator:&lt;br&gt;
The spread operator is used to spread the elements of an array.&lt;br&gt;
css&lt;/p&gt;

&lt;p&gt;var numbers = [1, 2, 3];&lt;br&gt;
var newNumbers = [...numbers, 4, 5];&lt;br&gt;
console.log(newNumbers);&lt;/p&gt;

&lt;p&gt;Destructuring:&lt;br&gt;
Destructuring is used to extract values from objects and arrays.&lt;/p&gt;

&lt;p&gt;var person = { name: "John", age: 30 };&lt;br&gt;
var { name } = person;&lt;br&gt;
console.log(name);&lt;/p&gt;

&lt;p&gt;Classes:&lt;br&gt;
Classes are a blueprint for creating objects in JavaScript.&lt;/p&gt;

&lt;p&gt;class Person {&lt;br&gt;
  constructor(name, age) {&lt;br&gt;
    this.name = name;&lt;br&gt;
    this.age = age;&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
var john = new Person("John", 30);&lt;br&gt;
console.log(john.name);&lt;/p&gt;

&lt;p&gt;Modules:&lt;br&gt;
Modules are used to organize and share code in JavaScript.&lt;/p&gt;

&lt;p&gt;export default function sayHello() {&lt;br&gt;
  console.log("Hello World!");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// in another file&lt;br&gt;
import sayHello from "./sayHello.js";&lt;br&gt;
sayHello();&lt;/p&gt;

&lt;p&gt;Promises:&lt;br&gt;
Promises are used to handle asynchronous operations in JavaScript.&lt;/p&gt;

&lt;p&gt;var promise = new Promise((resolve, reject) =&amp;gt; {&lt;br&gt;
  setTimeout(() =&amp;gt; {&lt;br&gt;
    resolve("Hello World!");&lt;br&gt;
  }, 1000);&lt;br&gt;
});&lt;br&gt;
promise.then(result =&amp;gt; console.log(result));&lt;/p&gt;

&lt;p&gt;Async/Await:&lt;br&gt;
Async/await is used to simplify the handling of asynchronous operations in JavaScript.&lt;/p&gt;

&lt;p&gt;async function getData() {&lt;br&gt;
  var result = await fetch("&lt;a href="https://jsonplaceholder.typicode.com/posts%22" rel="noopener noreferrer"&gt;https://jsonplaceholder.typicode.com/posts"&lt;/a&gt;);&lt;br&gt;
  var data = await result.json();&lt;br&gt;
  console.log(data);&lt;br&gt;
}&lt;br&gt;
getData();&lt;/p&gt;

&lt;p&gt;Map:&lt;br&gt;
The map method is used to transform elements in an array.&lt;br&gt;
typescript&lt;/p&gt;

&lt;p&gt;var numbers = [1, 2, 3];&lt;br&gt;
var doubledNumbers = numbers.map(number =&amp;gt; number * 2);&lt;br&gt;
console.log(doubledNumbers);&lt;/p&gt;

&lt;p&gt;Filter:&lt;br&gt;
The filter method is used to filter elements in an array.&lt;br&gt;
typescript&lt;/p&gt;

&lt;p&gt;var numbers = [1, 2, 3, 4, 5];&lt;br&gt;
var evenNumbers = numbers.filter(number =&amp;gt; number % 2 === 0);&lt;br&gt;
console.log(evenNumbers);&lt;/p&gt;

&lt;p&gt;Reduce:&lt;br&gt;
The reduce method is used to reduce an array to a single value.&lt;/p&gt;

&lt;p&gt;var numbers = [1, 2, 3, 4, 5];&lt;br&gt;
var sum = numbers.reduce((accumulator, currentValue) =&amp;gt; accumulator + currentValue, 0);&lt;br&gt;
console.log(sum);&lt;/p&gt;

&lt;p&gt;Rest and Spread Operators:&lt;br&gt;
The rest and spread operators are used to pass multiple arguments to a function or spread the elements of an array.&lt;/p&gt;

&lt;p&gt;function addNumbers(...numbers) {&lt;br&gt;
  return numbers.reduce((accumulator, currentValue) =&amp;gt; accumulator + currentValue, 0);&lt;br&gt;
}&lt;br&gt;
console.log(addNumbers(1, 2, 3, 4, 5));&lt;/p&gt;

</description>
      <category>announcement</category>
      <category>devto</category>
      <category>devrel</category>
    </item>
    <item>
      <title>Git cheatsheet 2023</title>
      <dc:creator>Rishabh-14</dc:creator>
      <pubDate>Mon, 23 Jan 2023 10:35:24 +0000</pubDate>
      <link>https://dev.to/rishabh14/git-cheatsheet-2023-2fmh</link>
      <guid>https://dev.to/rishabh14/git-cheatsheet-2023-2fmh</guid>
      <description>&lt;p&gt;Here is a list of some important Git commands along with one example for each:&lt;/p&gt;

&lt;p&gt;git init - Initialize a new Git repository&lt;/p&gt;

&lt;p&gt;git add - Add files to the repository's staging area&lt;br&gt;
Example: git add . (to add all files in the current directory)&lt;/p&gt;

&lt;p&gt;git commit - Create a new snapshot of the repository&lt;br&gt;
Example: git commit -m "Initial commit" (to commit with the message "Initial commit")&lt;/p&gt;

&lt;p&gt;git log - View the commit history of the repository&lt;br&gt;
Example: git log (to view the commit history)&lt;/p&gt;

&lt;p&gt;git diff - View the differences between the current state of the files and the last committed version&lt;br&gt;
Example: git diff (to view the differences)&lt;/p&gt;

&lt;p&gt;git revert - Create a new commit that undoes the changes made in a previous commit&lt;br&gt;
Example: git revert  (to revert to a specific commit)&lt;/p&gt;

&lt;p&gt;git reset - Discard commits and move the branch pointer to a previous commit&lt;br&gt;
Example: git reset --hard  (to reset the branch to a specific commit)&lt;/p&gt;

&lt;p&gt;git push - Upload the repository to a remote server&lt;br&gt;
Example: git push origin master (to push the master branch to the "origin" remote)&lt;/p&gt;

&lt;p&gt;git clone - Create a copy of a remote repository&lt;br&gt;
Example: git clone &lt;a href="https://github.com/username/repository.git" rel="noopener noreferrer"&gt;https://github.com/username/repository.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;git merge - Combine changes made in different branches&lt;br&gt;
Example: git merge feature (to merge the changes made in the "feature" branch into the current branch)&lt;/p&gt;

&lt;p&gt;git branch - View and manage branches&lt;br&gt;
Example: git branch -a (to view all branches, including remote branches)&lt;/p&gt;

&lt;p&gt;git remote - View and manage remote repositories&lt;br&gt;
Example: git remote -v (to view the list of remotes associated with the repository)&lt;/p&gt;

&lt;p&gt;git tag - Create and manage tags&lt;br&gt;
Example: git tag -a v1.0 -m "Initial release" (to create a new tag "v1.0" with the message "Initial release")&lt;/p&gt;

&lt;p&gt;git stash - Save changes temporarily without committing them&lt;br&gt;
Example: git stash save "Work in progress" (to save the changes with the message "Work in progress")&lt;/p&gt;

&lt;p&gt;git cherry-pick - Select specific commits from one branch and apply them to another branch&lt;br&gt;
Example: git cherry-pick  (to apply a specific commit to the current branch)&lt;/p&gt;

&lt;p&gt;git config - Configure Git settings&lt;br&gt;
Example: git config --global user.name "John Doe" (to set the user name as "John Doe" globally)&lt;/p&gt;

&lt;p&gt;git fetch - Download changes from a remote repository&lt;br&gt;
Example: git fetch origin (to download changes from the "origin" remote)&lt;/p&gt;

&lt;p&gt;git pull - Download changes from a remote repository and merge them with the local branches&lt;br&gt;
Example: git pull origin master (to download changes from the "origin" remote's "master" branch and merge them with the local "master" branch)&lt;/p&gt;

&lt;p&gt;git status - View the status of the repository&lt;br&gt;
Example: git status (to view the status of the current repository)&lt;/p&gt;

&lt;p&gt;git blame - Show who last modified each line of a file&lt;br&gt;
Example: git blame  (to view the last modification of each line of a specific file)&lt;/p&gt;

&lt;p&gt;git ls-files - Show information about files in the index and the working tree&lt;br&gt;
Example: git ls-files --stage (to list all the files in the staging area and the status of each file)&lt;/p&gt;

&lt;p&gt;git clean - Remove untracked files from the working tree&lt;br&gt;
Example: git clean -df (to remove all untracked files and directories)&lt;/p&gt;

&lt;p&gt;git mv - Move or rename a file, a directory, or a symlink&lt;br&gt;
Example: git mv   (to move a file to a new location)&lt;/p&gt;

&lt;p&gt;git submodule - Initialize, update or inspect submodules&lt;br&gt;
Example: git submodule add   (to add a submodule to the current repository)&lt;/p&gt;

&lt;p&gt;git lfs - Large file support extension for Git&lt;br&gt;
Example: git lfs install (to install Git LFS extension)&lt;/p&gt;

&lt;p&gt;git rebase - Reapply commits on top of another base tip&lt;br&gt;
Example: git rebase -i  (to rebase the current branch onto the specified branch interactively)&lt;/p&gt;

&lt;p&gt;git archive - Create a tar or zip archive of the contents of the repository&lt;br&gt;
Example: git archive -o .zip HEAD (to create a zip archive of the contents of the repository)&lt;/p&gt;

&lt;p&gt;git gc - Cleanup unnecessary files and optimize the repository&lt;br&gt;
Example: git gc (to perform a garbage collection on the current repository)&lt;/p&gt;

&lt;p&gt;git filter-branch - Rewrite the entire history of the repository&lt;br&gt;
Example: git filter-branch --tree-filter 'rm -rf ' HEAD (to remove a directory from the entire history of the repository)&lt;/p&gt;

&lt;p&gt;git bisect - Find the commit that introduced a bug&lt;br&gt;
Example: git bisect start (to start the bisect process)&lt;/p&gt;

&lt;p&gt;git switch - Switch branch or create a new branch&lt;br&gt;
Example: git switch -c  (to create a new branch and switch to it)&lt;/p&gt;

&lt;p&gt;git restore - Restore working tree files&lt;br&gt;
Example: git restore  (to restore a specific file to its previous state)&lt;/p&gt;

&lt;p&gt;The git switch command allows you to switch to an existing branch or create a new branch. This command is similar to git checkout but it also allows you to create a new branch with the -c option.&lt;/p&gt;

&lt;p&gt;The git restore command allows you to restore files in your working tree to their previous state. This command can be used to restore a specific file, a directory or even the entire repository. It's similar to git checkout but it's more powerful and flexible.&lt;/p&gt;

&lt;p&gt;It's important to note that, git switch is available since git version 2.23 and git restore is available since git version 2.25, if you are using an older version of git, these commands might not be available.&lt;/p&gt;

&lt;p&gt;These commands are more advanced, but they can be very useful in specific scenarios. Git LFS can help to manage large files, git rebase and filter-branch can be used to rewrite the repository history and git bisect can help to find the commit that introduced a bug. As with the previous commands, it is important to understand the underlying concepts and the implications of each command before using them&lt;/p&gt;

&lt;p&gt;Wishing you guys a lucky 2023! Please give a like!!&lt;/p&gt;

</description>
      <category>react</category>
      <category>discuss</category>
      <category>softwaredevelopment</category>
      <category>bug</category>
    </item>
  </channel>
</rss>
